@spinajs/exceptions
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,22 +1,65 @@ | ||
/** | ||
* Base class of all exceptions in framework | ||
*/ | ||
export declare class Exception extends Error { | ||
/** | ||
* Constructs new exception with message | ||
* @param message - error message | ||
*/ | ||
constructor(message?: string); | ||
} | ||
/** | ||
* Exception thrown when functionality is not supported | ||
*/ | ||
export declare class NotSupportedException extends Exception { | ||
} | ||
/** | ||
* Exception thrown when argument passed to function is invalid eg. out of range | ||
*/ | ||
export declare class ArgumentException extends Exception { | ||
} | ||
/** | ||
* The exception that is thrown when a method call is invalid for the object's current state. | ||
*/ | ||
export declare class InvalidOperationException extends Exception { | ||
} | ||
/** | ||
* Exception is thrown when authentication fails eg. user credentials are invalid | ||
*/ | ||
export declare class AuthenticationException extends Exception { | ||
} | ||
/** | ||
* Exception is thrown when request data are invalid | ||
*/ | ||
export declare class BadRequestException extends Exception { | ||
} | ||
/** | ||
* Exception indicating that an access to resource by a client has been forbidden by the server | ||
* HTTP 403 - Forbidden | ||
*/ | ||
export declare class ForbiddenException extends Exception { | ||
} | ||
/** | ||
* Exception thrown when there was error with IO operations ie. not accessible file | ||
*/ | ||
export declare class IOException extends Exception { | ||
} | ||
/** | ||
* The exception that is thrown when resource is not found eg. model in database or missing file | ||
*/ | ||
export declare class NotFoundException extends Exception { | ||
} | ||
/** | ||
* The exception that is thrown when method is not implemented | ||
*/ | ||
export declare class NotImplementedException extends Exception { | ||
} | ||
/** | ||
* The exception that is thrown when strange things happends in server eg. generic server error | ||
*/ | ||
export declare class ServerErrorException extends Exception { | ||
} | ||
/** | ||
* The exception that is thrown when JSON entity is checked against schema and is invalid | ||
*/ | ||
export declare class ValidationException extends Exception { | ||
@@ -26,5 +69,12 @@ Errors: any; | ||
} | ||
/** | ||
* The exception that is thrown when JSON entity is checked against schema and is invalid | ||
*/ | ||
export declare class NotAcceptedException extends Exception { | ||
} | ||
/** | ||
* The exception that is thrown if app not supports requestes `Accept` header eg. if client wants | ||
* html response but server can send only json. | ||
*/ | ||
export declare class NotAcceptableException extends Exception { | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Base class of all exceptions in framework | ||
*/ | ||
class Exception extends Error { | ||
/** | ||
* Constructs new exception with message | ||
* @param message - error message | ||
*/ | ||
constructor(message) { | ||
@@ -9,29 +16,66 @@ super(message); | ||
exports.Exception = Exception; | ||
/** | ||
* Exception thrown when functionality is not supported | ||
*/ | ||
class NotSupportedException extends Exception { | ||
} | ||
exports.NotSupportedException = NotSupportedException; | ||
/** | ||
* Exception thrown when argument passed to function is invalid eg. out of range | ||
*/ | ||
class ArgumentException extends Exception { | ||
} | ||
exports.ArgumentException = ArgumentException; | ||
/** | ||
* The exception that is thrown when a method call is invalid for the object's current state. | ||
*/ | ||
class InvalidOperationException extends Exception { | ||
} | ||
exports.InvalidOperationException = InvalidOperationException; | ||
/** | ||
* Exception is thrown when authentication fails eg. user credentials are invalid | ||
*/ | ||
class AuthenticationException extends Exception { | ||
} | ||
exports.AuthenticationException = AuthenticationException; | ||
/** | ||
* Exception is thrown when request data are invalid | ||
*/ | ||
class BadRequestException extends Exception { | ||
} | ||
exports.BadRequestException = BadRequestException; | ||
/** | ||
* Exception indicating that an access to resource by a client has been forbidden by the server | ||
* HTTP 403 - Forbidden | ||
*/ | ||
class ForbiddenException extends Exception { | ||
} | ||
exports.ForbiddenException = ForbiddenException; | ||
/** | ||
* Exception thrown when there was error with IO operations ie. not accessible file | ||
*/ | ||
class IOException extends Exception { | ||
} | ||
exports.IOException = IOException; | ||
/** | ||
* The exception that is thrown when resource is not found eg. model in database or missing file | ||
*/ | ||
class NotFoundException extends Exception { | ||
} | ||
exports.NotFoundException = NotFoundException; | ||
/** | ||
* The exception that is thrown when method is not implemented | ||
*/ | ||
class NotImplementedException extends Exception { | ||
} | ||
exports.NotImplementedException = NotImplementedException; | ||
/** | ||
* The exception that is thrown when strange things happends in server eg. generic server error | ||
*/ | ||
class ServerErrorException extends Exception { | ||
} | ||
exports.ServerErrorException = ServerErrorException; | ||
/** | ||
* The exception that is thrown when JSON entity is checked against schema and is invalid | ||
*/ | ||
class ValidationException extends Exception { | ||
@@ -44,5 +88,12 @@ constructor(message, validationErrors) { | ||
exports.ValidationException = ValidationException; | ||
/** | ||
* The exception that is thrown when JSON entity is checked against schema and is invalid | ||
*/ | ||
class NotAcceptedException extends Exception { | ||
} | ||
exports.NotAcceptedException = NotAcceptedException; | ||
/** | ||
* The exception that is thrown if app not supports requestes `Accept` header eg. if client wants | ||
* html response but server can send only json. | ||
*/ | ||
class NotAcceptableException extends Exception { | ||
@@ -49,0 +100,0 @@ } |
{ | ||
"name": "@spinajs/exceptions", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "exceptions definitions used all across framework modules", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8452
178