Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lemonmojo
Created June 28, 2016 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lemonmojo/98c9534de6a3f101b9a8261bb1a81a81 to your computer and use it in GitHub Desktop.
Save lemonmojo/98c9534de6a3f101b9a8261bb1a81a81 to your computer and use it in GitHub Desktop.
#ifndef LMExceptionError_h
#define LMExceptionError_h
#define LMExceptionErrorClass NSClassFromString(@"LMExceptionError")
@protocol LMExceptionError <NSObject>
@property (readonly) NSString* exceptionTypeName;
@property (readonly) NSString* message;
@property (readonly) NSString* source;
@property (readonly) NSString* stackTrace;
@property (readonly) NSString* helpLink;
@property (readonly) NSObject<LMExceptionError>* innerError;
+ (void)try:(void (^) (void))tryBlock error:(NSError**)error;
+ (void)try:(void (^) (void))tryBlock catch:(void (^) (NSObject<LMExceptionError>*))catchBlock;
+ (void)try:(void (^) (void))tryBlock catch:(void (^) (NSObject<LMExceptionError>*))catchBlock finally:(void (^) (void))finallyBlock;
@end
#endif /* LMExceptionError_h */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment