{"version":3,"sources":["../../src/types/exceptions.ts"],"sourcesContent":["export class RoutesRootNotFound extends Error {\n    constructor(root: string) {\n        super(`Routes root not found: ${root}`);\n        this.name = \"RoutesRootNotFound\";\n    }\n}\n\nexport class InvalidRouteHandler extends Error {\n    constructor(method: string, file: string) {\n        super(`Invalid handler for method \"${method}\" in \"${file}\". Expected a function.`);\n        this.name = \"InvalidRouteHandler\";\n    }\n}\n\nexport class UnknownPluginError extends Error {\n    constructor(pluginName: string, route: string, available: string[]) {\n        super(\n            `Unknown plugin \"${pluginName}\" in route \"${route}\"` +\n            (available.length\n                ? `Available plugins: ${available.join(\", \")}.`\n                : `No plugins are registered.`)\n        );\n        this.name = \"UnknownPluginError\";\n    }\n}\n\nexport class InvalidPluginError extends Error {\n    constructor(message: string) {\n        super(`[plugin] ${message}`);\n        this.name = \"InvalidPluginError\";\n    }\n}\n\nexport class TimeoutError extends Error {\n    readonly ms: number;\n\n    constructor(ms: number, message = \"Request timed out\") {\n        super(message);\n        this.name = \"TimeoutPluginError\";\n        this.ms = ms;\n    }\n}\n"],"mappings":"AAAO,MAAM,2BAA2B,MAAM;AAAA,EAC1C,YAAY,MAAc;AACtB,UAAM,0BAA0B,IAAI,EAAE;AACtC,SAAK,OAAO;AAAA,EAChB;AACJ;AAEO,MAAM,4BAA4B,MAAM;AAAA,EAC3C,YAAY,QAAgB,MAAc;AACtC,UAAM,+BAA+B,MAAM,SAAS,IAAI,yBAAyB;AACjF,SAAK,OAAO;AAAA,EAChB;AACJ;AAEO,MAAM,2BAA2B,MAAM;AAAA,EAC1C,YAAY,YAAoB,OAAe,WAAqB;AAChE;AAAA,MACI,mBAAmB,UAAU,eAAe,KAAK,OAChD,UAAU,SACL,sBAAsB,UAAU,KAAK,IAAI,CAAC,MAC1C;AAAA,IACV;AACA,SAAK,OAAO;AAAA,EAChB;AACJ;AAEO,MAAM,2BAA2B,MAAM;AAAA,EAC1C,YAAY,SAAiB;AACzB,UAAM,YAAY,OAAO,EAAE;AAC3B,SAAK,OAAO;AAAA,EAChB;AACJ;AAEO,MAAM,qBAAqB,MAAM;AAAA,EAGpC,YAAY,IAAY,UAAU,qBAAqB;AACnD,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,KAAK;AAAA,EACd;AACJ;","names":[]}