Commits

Ryan Wilcox committed 4502dc9

added nsErrorPlusFileInformation: debugging for NSError

Comments (0)

Files changed (1)

 NSAppleEventDescriptor* runApplescriptNamedInFolderBundle(NSString* scriptName, NSString* inFolderBundle, NSDictionary** errorDict);
 NSString* applicationSupportFolder(NSString* applicationName, BOOL shouldCreate);
 
+	/*!
+		@macro nsErrorPlusFileInformation
+		@abstract provides useful debugging information for NSError objects
+		@description Use like:
+			*theErr = [NSError errorWithDomain:@"functionDoesHaveErrorDomain"
+						  code:2
+						  userInfo:[NSDictionary dictionaryWithObjectsAndKeys:
+							NSLocalizedDescriptionKey,   NSLocalizedString(@"The foo got into my bar!", @""),
+							nsErrorPlusFileInformation,
+							nil]];
+		
+		
+	*/
+#define nsErrorPlusFileInformation \
+[NSString stringWithUTF8String:__FILE__],   @"reportingFile",				\
+[NSNumber numberWithInt:__LINE__],   @"reportingLine",						\
+[NSString stringWithUTF8String:__PRETTY_FUNCTION__], @"reportingMethod"	\
+