Commits

boredzo  committed 08f47da

Improved our handling of errors in our NSDocument code. We no longer make up our own error codes, and we now abuse NSLocalizedRecoverySuggestionErrorKey to get prettier presentation of error messages (using NSLocalizedFailureReasonErrorKey, like we're supposed to do, ends up with everything stuffed into the headline, which is ugly).

  • Participants
  • Parent commits 0fe46bc
  • Branches default

Comments (0)

Files changed (1)

File Developer Tools/Growl Registration Dictionary Editor/GRDEDocument.m

 													errorDescription:&errorString];
 	if (errorString) {
 		if (outError)
-			*outError = [NSError errorWithDomain:@"NSPropertyListSerialization" code:2 userInfo:[NSDictionary dictionaryWithObject:errorString forKey:NSLocalizedFailureReasonErrorKey]];
+			*outError = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:[NSDictionary dictionaryWithObject:errorString forKey:NSLocalizedRecoverySuggestionErrorKey]];
 		NSLog(@"Could not write dictionary:\n%@", dictionaryRepresentation);
 	}
 
 														  errorDescription:&errorString];
 	if (errorString) {
 		if (outError)
-			*outError = [NSError errorWithDomain:@"NSPropertyListSerialization" code:1 userInfo:[NSDictionary dictionaryWithObject:errorString forKey:NSLocalizedFailureReasonErrorKey]];
+			*outError = [NSError errorWithDomain:@"NSPropertyListSerialization" code:1 userInfo:[NSDictionary dictionaryWithObject:errorString forKey:NSLocalizedRecoverySuggestionErrorKey]];
 	}
 	if (dict) {
 		if (!dictionaryRepresentation)