MYErrorUtils.h
changeset 27 256370e8935a
parent 22 a9da6c5d3f7c
     1.1 --- a/MYErrorUtils.h	Sat Apr 04 20:53:53 2009 -0700
     1.2 +++ b/MYErrorUtils.h	Sun May 03 10:13:31 2009 -0700
     1.3 @@ -24,6 +24,13 @@
     1.4  NSError *MYError( int errorCode, NSString *domain, NSString *messageFormat, ... ) 
     1.5                                  __attribute__ ((format (__NSString__, 3, 4)));
     1.6  
     1.7 +/** A variant of MYError, useful for returning from a method.
     1.8 +    If errorCode is nonzero, constructs an NSError and stores it into *outError,
     1.9 +    then returns NO. Otherwise returns YES. */
    1.10 +BOOL MYReturnError( NSError **outError,
    1.11 +                    int errorCode, NSString *domain, NSString *messageFormat, ... ) 
    1.12 +                                __attribute__ ((format (__NSString__, 4, 5)));
    1.13 +
    1.14  /** Convenience function for creating NSErrors.
    1.15      Stores an NSError into *error, and returns NO.
    1.16      Domain will be MYErrorDomain, code will be kMYErrorMisc.