@piggly/fastify-chassis
Version:
An ESM/CommonJS toolkit to help you to do common operations in your back-end applications with Fastify and NodeJS.
31 lines • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CORSNotAllowedError = void 0;
const ddd_toolkit_1 = require("@piggly/ddd-toolkit");
const crc_1 = require("crc");
/**
* @file This error should be thrown when CORS is not allowed.
* @since 5.5.0
* @copyright Piggly Lab 2025
* @author Caique Araujo <caique@piggly.com.br>
*/
class CORSNotAllowedError extends ddd_toolkit_1.ApplicationError {
/**
* Create a new error.
* Useful for: CORS not allowed.
* Code: 2413539071
*
* It is not an default Error class, it is a domain error.
* Should be not thrown, but used as a domain error.
* You may use it to return in a Result object from @piggly/ddd-toolkit.
*
* @memberof CORSNotAllowedError
* @since 1.0.0
* @author Caique Araujo <caique@piggly.com.br>
*/
constructor() {
super('CORSNotAllowedError', (0, crc_1.crc32)('CORSNotAllowedError'), 'The request is not allowed by CORS.', 403, 'Check the request URL and try again.');
}
}
exports.CORSNotAllowedError = CORSNotAllowedError;
//# sourceMappingURL=CORSNotAllowedError.js.map