Added URLUtils. Rewrote Target.
5 // Created by Jens Alfke on 4/28/08.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
12 @implementation NSHTTPURLResponse (MYUtilities)
15 - (NSError*) HTTPError
17 // HTTP status >= 300 is considered an error:
18 int status = self.statusCode;
20 NSString *reason = NSLocalizedStringFromTable( @"HTTP_ERROR_MESSAGE",@"UKCrashReporter",@"");
21 reason = [NSHTTPURLResponse localizedStringForStatusCode: status];
22 NSDictionary *info = $dict({NSLocalizedFailureReasonErrorKey,reason});
23 return [NSError errorWithDomain: MyHTTPErrorDomain code: status userInfo: info];
29 NSString* const MyHTTPErrorDomain = @"HTTP";