16 lines
298 B
TypeScript
16 lines
298 B
TypeScript
/**
|
|
* @file
|
|
* @copyright 2020, Valentin Anger
|
|
* @license ISC
|
|
*/
|
|
|
|
export default class IrcError extends Error {
|
|
constructor(public message: string, public code?: string) {
|
|
super();
|
|
}
|
|
|
|
toString(): string {
|
|
return this.message + this.code == undefined ? "" : ": " + this.code;
|
|
}
|
|
}
|