@iotile/iotile-common
Version:
Common utilities for IoTile Packages and Applications
142 lines (141 loc) • 4.44 kB
TypeScript
/**
* @ngdoc object
* @name Errors.type:BaseError
* @description
* The base error class for all exceptions. All exceptions must
* have a name that should match the name of their class and a user
* settable message. Typically, subclasses of BaseError will fill in the
* name field in their own constructor, so users do not have to set it.
*
* @property {string} name The name of of the exception, which is intended
* to be used as a method of filtering different exceptions.
* @property {string} message A freeform message that provides more detail
* into what caused this error.
*/
export declare class BaseError {
name: string;
message: string;
constructor(name: string, message: string);
}
/**
* @ngdoc object
* @name Errors.type:ArgumentError
* @description
* There was an issue with one of the parameters passed to this function.
* The parameter was invalid. The included message should contain more
* details about what was expected vs received.
*/
export declare class ArgumentError extends BaseError {
constructor(message: string);
}
/**
* @ngdoc object
* @name Errors.type:InvalidOperationError
* @description
* The operation could not be performed at the time that it
* was requested. This may be because the application's state
* did not allow its preconditions to be met.
*/
export declare class InvalidOperationError extends BaseError {
constructor(message: string);
}
/**
* @ngdoc object
* @name Errors.type:UnknownError
* @description
* There was an unspecified error with the operation.
* See the message property for more details.
*/
export declare class UnknownError extends BaseError {
constructor(message: string);
}
/**
* @ngdoc object
* @name Errors.type:InsufficientSpaceError
* @description
* There was not sufficient space to perform this operation. This error
* could be thrown, if, for example, you were trying to append data to a fixed
* size buffer and there was not room in the buffer for all the data you wanted
* to append.
*/
export declare class InsufficientSpaceError extends BaseError {
constructor(message: string);
}
/**
* @ngdoc object
* @name Errors.type:UnknownKeyError
* @description
* A key was passed to a lookup table and it was not found.
*/
export declare class UnknownKeyError extends BaseError {
constructor(message: string);
}
/**
* @ngdoc object
* @name Errors.type:FileSystemError
* @description
* There was an error interacting with the file system on
* the device.
*/
export declare class FileSystemError {
static readonly NOT_FOUND_ERR: number;
static readonly SECURITY_ERR: number;
static readonly ABORT_ERR: number;
static readonly NOT_READABLE_ERR: number;
static readonly ENCODING_ERR: number;
static readonly NO_MODIFICATION_ALLOWED_ERR: number;
static readonly INVALID_STATE_ERR: number;
static readonly SYNTAX_ERR: number;
static readonly INVALID_MODIFICATION_ERR: number;
static readonly QUOTA_EXCEEDED_ERR: number;
static readonly TYPE_MISMATCH_ERR: number;
static readonly PATH_EXISTS_ERR: number;
message: string;
name: string;
code: number;
constructor(name: string, message: string, code: number);
}
/**
* @ngdoc object
* @name Errors.type:UnknownFileSystemError
*
* @description
* There was an error interacting with the file system on
* the device.
*/
export declare class UnknownFileSystemError extends FileSystemError {
constructor(code: number, path?: string);
}
/**
* @ngdoc object
* @name Errors.type:BatchOperationError
*
* @description
* A batch operation failed for one or more elements that
* were addressed. The individual errors are listed in the
* errors property.
*/
export declare class BatchOperationError {
name: string;
message: string;
errors: FileSystemError[];
constructor(message: string, errors: FileSystemError[]);
}
export declare class InvalidDataError {
name: string;
message: string;
constructor(name: string, message: string);
}
export declare class UserNotLoggedInError {
message: string;
constructor(message: string);
}
export declare class DataCorruptedError extends InvalidDataError {
constructor(message: string);
}
export declare class DataStaleError extends InvalidDataError {
constructor(message: string);
}
export declare class CorruptDeviceError extends InvalidDataError {
constructor(message: string);
}