daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Aug 12th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func catchFunc<T>(throwable: @escaping () throws -> T) -> ((Error) -> T) -> T {
  2.    
  3.     return { catchable in
  4.        
  5.         do {
  6.            
  7.             return try throwable()
  8.            
  9.         } catch {
  10.            
  11.             return catchable(error)
  12.            
  13.         }
  14.     }
  15. }
RAW Paste Data
Top