Last active
September 22, 2015 02:32
-
-
Save alfwatt/cb76d78888008e27a44d to your computer and use it in GitHub Desktop.
+ (NSString*) errorReport:(NSError*) error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (NSString*) errorReport:(NSError*) error | |
{ | |
NSMutableString* report = [NSMutableString new]; | |
[report appendString:[NSString stringWithFormat:@"%@: %li\n\n%@", error.domain, error.code, error.userInfo]]; | |
if( error = [[error userInfo] objectForKey:NSUnderlyingErrorKey] ) // we have to go deeper | |
{ | |
[report appendString:[NSString stringWithFormat:@"\n\n- Underlying Error -\n\n"]]; | |
[report appendString:[self errorReport:error]]; | |
} | |
return report; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment