Skip to content

Commit

Permalink
- Renamed kLMErrorInternalDomain and used it for internal errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevazquez committed Oct 5, 2010
1 parent 7fe32da commit c2804cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/LMErrorKit/LMErrorHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#import "LMErrorKitTypes.h"
#import "LMErrorHandlerDelegate.h"

FOUNDATION_EXPORT NSString *const kLMErrorInternalDomain;

// Callback type constants. For internal use only.
enum LMErrorHandlerCallbackType {
kLMErrorHandlerCallbackTypeSelector,
Expand Down
7 changes: 4 additions & 3 deletions src/LMErrorKit/LMErrorHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

#import "LMErrorHandler.h"

NSString *const LMErrorInternalDomain = @"com.littlemustard.LMErrorKit.InternalDomain";
#warning move to a separate file with all define error codes
NSString *const kLMErrorInternalDomain = @"com.littlemustard.LMErrorKit.InternalDomain";

void throwError(NSError *error) {
NSLog(@"failed to throw the error: %@", error);
Expand Down Expand Up @@ -64,7 +65,7 @@ + (LMErrorHandler *)errorHandlerWithReceiver:(id)receiver selector:(SEL)selector

// Verify that selector takes just one (id) argument
if ([errorHandler validArgumentCountForSelectorHandler] != 1) {
throwError([NSError errorWithDomain:NSOSStatusErrorDomain code:kEINVALErr userInfo:nil]);
throwError([NSError errorWithDomain:kLMErrorInternalDomain code:1 userInfo:nil]);
return nil;
}

Expand All @@ -81,7 +82,7 @@ + (LMErrorHandler *)errorHandlerWithReceiver:(id)receiver selector:(SEL)selector
// Verify that selector takes two (id) arguments
if ([errorHandler validArgumentCountForSelectorHandler] != 2) {
#warning Try using the wrong Handler to check user experience on error.
throwError([NSError errorWithDomain:NSOSStatusErrorDomain code:kEINVALErr userInfo:nil]);
throwError([NSError errorWithDomain:kLMErrorInternalDomain code:1 userInfo:nil]);
return nil;
}

Expand Down

0 comments on commit c2804cd

Please sign in to comment.