UNPKG

routing-controllers

Version:

Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.

14 lines 557 B
import { ForbiddenError } from '../http-error/ForbiddenError'; /** * Thrown when route is guarded by @Authorized decorator. */ export class AccessDeniedError extends ForbiddenError { constructor(action) { super(); this.name = 'AccessDeniedError'; Object.setPrototypeOf(this, AccessDeniedError.prototype); const uri = `${action.request.method} ${action.request.url}`; // todo: check it it works in koa this.message = `Access is denied for request on ${uri}`; } } //# sourceMappingURL=AccessDeniedError.js.map