mirror of
https://github.com/nvms/prsm.git
synced 2025-12-16 08:00:53 +00:00
15 lines
293 B
TypeScript
15 lines
293 B
TypeScript
export class CodeError extends Error {
|
|
code: string;
|
|
name: string;
|
|
|
|
constructor(message: string, code?: string, name?: string) {
|
|
super(message);
|
|
if (typeof code === "string") {
|
|
this.code = code;
|
|
}
|
|
if (typeof name === "string") {
|
|
this.name = name;
|
|
}
|
|
}
|
|
}
|