UNPKG

typenexus

Version:

TypeNexus is a good tool for API encapsulation and management. It provides a clean and lightweight way to package TypeORM functionality, helping you build applications faster while reducing template code redundancy and type conversion work.

17 lines (14 loc) 487 B
import { Action } from '../Action.js'; import { ForbiddenError } from './ForbiddenError.js'; /** * Thrown when route is guarded by @Authorized decorator. */ export class AccessDeniedError extends ForbiddenError { name = 'AccessDeniedError'; constructor(action: Action) { super(); Object.setPrototypeOf(this, AccessDeniedError.prototype); const uri = `${action.request.method} ${action.request.url}`; this.message = `Access is denied for request on ${uri}`; } }