diff --git a/lib/Errors.d.ts b/lib/Errors.d.ts index 2faeddc6..4a401a7e 100644 --- a/lib/Errors.d.ts +++ b/lib/Errors.d.ts @@ -2,6 +2,10 @@ export declare class ManagerNotFound extends Error { managerUID: string; constructor(managerUID: string); } +export declare class SerializerNotFound extends Error { + serializerUID: string; + constructor(serializerUID: string); +} export declare class HTTPError extends Error { HTTPCode: number; inheritedError: Error; @@ -28,11 +32,11 @@ export declare const Errors: { NoSizeForAFolder: Error; IllegalArguments: Error; MustIgnore: Error; - SerializerNotFound: Error; Locked: Error; InsufficientStorage: Error; IntermediateResourceMissing: Error; WrongParentTypeForCreation: Error; + NotEnoughPrivilege: Error; None: any; }; export default Errors; diff --git a/lib/Errors.js b/lib/Errors.js index 9466d1bd..fef58248 100644 --- a/lib/Errors.js +++ b/lib/Errors.js @@ -20,6 +20,16 @@ var ManagerNotFound = (function (_super) { return ManagerNotFound; }(Error)); exports.ManagerNotFound = ManagerNotFound; +var SerializerNotFound = (function (_super) { + __extends(SerializerNotFound, _super); + function SerializerNotFound(serializerUID) { + var _this = _super.call(this, 'Cannot find the serializer : ' + serializerUID) || this; + _this.serializerUID = serializerUID; + return _this; + } + return SerializerNotFound; +}(Error)); +exports.SerializerNotFound = SerializerNotFound; var HTTPError = (function (_super) { __extends(HTTPError, _super); function HTTPError(HTTPCode, inheritedError) { @@ -53,11 +63,11 @@ exports.Errors = { NoSizeForAFolder: new Error('Cannot get the size of a folder type resource.'), IllegalArguments: new Error('Illegal arguments.'), MustIgnore: new Error('There was an error but it must not stop the processing.'), - SerializerNotFound: new Error('One serializer could not be found.'), Locked: new Error('The resource is locked, operation forbidden.'), InsufficientStorage: new Error('Insufficient storage space.'), IntermediateResourceMissing: new Error('One or more intermediate resources are missing for this operation.'), WrongParentTypeForCreation: new Error('Cannot create a child resource to a non directory resource.'), + NotEnoughPrivilege: new Error('Not enough privilege.'), None: null }; exports.default = exports.Errors; diff --git a/src/Errors.ts b/src/Errors.ts index 7fab9ee9..c480fce9 100644 --- a/src/Errors.ts +++ b/src/Errors.ts @@ -7,6 +7,14 @@ export class ManagerNotFound extends Error } } +export class SerializerNotFound extends Error +{ + constructor(public serializerUID : string) + { + super('Cannot find the serializer : ' + serializerUID); + } +} + export class HTTPError extends Error { constructor(public HTTPCode : number, public inheritedError ?: Error) @@ -38,11 +46,11 @@ export const Errors = { NoSizeForAFolder: new Error('Cannot get the size of a folder type resource.'), IllegalArguments: new Error('Illegal arguments.'), MustIgnore: new Error('There was an error but it must not stop the processing.'), - SerializerNotFound: new Error('One serializer could not be found.'), Locked: new Error('The resource is locked, operation forbidden.'), InsufficientStorage: new Error('Insufficient storage space.'), IntermediateResourceMissing: new Error('One or more intermediate resources are missing for this operation.'), WrongParentTypeForCreation: new Error('Cannot create a child resource to a non directory resource.'), + NotEnoughPrivilege: new Error('Not enough privilege.'), None: null };