#import <NetcdfStepError.h>
Public Member Functions | |
| (NSError *) | - initWithErrorNumber:info: |
| Initializes an NSError with the error code, domain set to "netCDF" and a localized error message. | |
Static Public Member Functions | |
| (NSString *) | + errorMessageNumber: |
| Convert error code into localized error message. | |
| (NSError *) | + errorWithErrorNumber:info: |
| Returns an autoreleased NSError with the error code, domain and localized error message set. | |
Support for custom error codes, messages and data.
The methods support custom information to the [NSError -userInfo] dictionary. By convention, the keys are:
key: "path" value: NSString of the path of the dataset, or attempted creation of a dataset.
key: "class" value: NSString of the class name of the object that generated the error.
key: "name" value: NSString of the name of the object that generated the error.
key: "NSLocalizedDescriptionKey" value: NSString of error message specific to netCDF or NetcdfStep
In addition the the error codes and messages provided by netCDF, NetcdfStep defines the following codes and messages:
NCS_STRINGSIZE_E -128: NSString longer than dimension of offset for writing
NCS_DATASIZE_E -129: NSData is too small for reading or writing
NCS_ARRAYSIZE_E -130: NSArray has fewer members than dimension or offset for writing
NCS_STRINGENCODING_E -131: NSString Unicode can't be converted to C string with default encoding
NCS_ENABLEREMOTE_E -132: Remote URL access is not enabled
The error messages are localizable.
| + (NSString *) errorMessageNumber: | (int) | errNo |
Convert error code into localized error message.
In addition the the error codes and messages defined by netCDF, NetcdfStep defines the following codes and messages:
NCS_STRINGSIZE_E -128: NSString longer than dimension of offset for writing
NCS_DATASIZE_E -129: NSData is too small for reading or writing
NCS_ARRAYSIZE_E -130: NSArray has fewer members than dimension or offset for writing
NCS_STRINGENCODING_E -131: NSString Unicode can't be converted to C string with default encoding
NCS_ENABLEREMOTE_E -132: Remote URL access is not enabled
Returns a localized error message.
| + (NSError *) errorWithErrorNumber: | (int) | errNo | ||
| info: | (NSDictionary *) | info | ||
Returns an autoreleased NSError with the error code, domain and localized error message set.
See -(NSError *) initWithErrorNumber:info:
| - (NSError *) initWithErrorNumber: | (int) | errNo | ||
| info: | (NSDictionary *) | info | ||
Initializes an NSError with the error code, domain set to "netCDF" and a localized error message.
A default userInfo will be created even if the passed in info is nil or empty. By convention, methods that use this method will add other information to the user info dictionary. The new keys are:
key: "name" value: NSString name of the object
key: "class" value: NSString class name of object
key: "path" value: NSString path to netCDF file
The error number should be either:
A system error number from errno.h
A netCDF error returned by a library call.
A NetcdfStep error from NetcdfStepErrors.h
It will be translated into a localized error message and saved in the userInfo under the key NSLocalizedDescriptionKey.
1.5.7.1