Adun  0.83
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Error Creation
Functions
Collaboration diagram for Error Creation:

Functions

NSError * AdCreateError (NSString *domain, int code, NSString *localizedDescription, NSString *detailedDescription, NSString *recoverySuggestion)
NSError * AdKnownExceptionError (int code, NSString *localizedDescription, NSString *detailedDescription, NSString *recoverySuggestion)
NSError * AdErrorWithUnderlyingError (NSString *domain, int code, NSString *localizedDescription, NSString *detailedDescription, NSString *recoverySuggestion, NSError *underlyingError)
NSError * AdCreateEnergyError (AdSystem *system, NSString *interactionType, NSArray *interactingAtoms)
void AdGSLErrorHandler (const char *reason, const char *file, int line, int gsl_errno)

Detailed Description

Convience functions for creating error objects.


Function Documentation

NSError* AdCreateEnergyError ( AdSystem system,
NSString *  interactionType,
NSArray *  interactingAtoms 
)

Function for creating an NSError object related to a problem when calculating the energy of a particular interaciton. The returned NSError object details the atoms and interaction that caused the problem.

NSError* AdCreateError ( NSString *  domain,
int  code,
NSString *  localizedDescription,
NSString *  detailedDescription,
NSString *  recoverySuggestion 
)

Returns an NSError object with domain domain and the given code. In addition creates a userInfo dictionary with keys NSLocalizedDescriptionKey, AdDetailedDescriptionKey, and NSRecoverySuggestionKey whose values are the strings given by localizedDescription, detailedDescription, and recoverySuggestion respectively. When Adun catches an exception is checks the userInfo dictionary for the key AdKnownExceptionError. If it exists the value for this key should be an NSError object returned by this function. Adun knows what values can be present in the dictionary of an AdKnownExceptionError and hence will display this information to the user.

NSError* AdErrorWithUnderlyingError ( NSString *  domain,
int  code,
NSString *  localizedDescription,
NSString *  detailedDescription,
NSString *  recoverySuggestion,
NSError *  underlyingError 
)

As AdCreateError() but adding underlyingError to the returned objects userInfo dictionary with key NSUnderlyingErrorKey. If underlyingError is nil this method is the same as AdCreateError().

void AdGSLErrorHandler ( const char *  reason,
const char *  file,
int  line,
int  gsl_errno 
)

GSL Error handler for the framework. Its raises an exception containing an error object detailing the cause of the error in its user info dict with key NSUnderlyingErrorKey

NSError* AdKnownExceptionError ( int  code,
NSString *  localizedDescription,
NSString *  detailedDescription,
NSString *  recoverySuggestion 
)

As AdCreateError but with domain set to AdunKernel.ErrorDomain.

Todo:
Rename to AdKernelFrameworkError.