Add custom errors

pull/73/head
MillenniumEarl 2021-02-25 19:06:36 +01:00
parent 739c39b5f8
commit 827564ca05
1 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,44 @@
"use strict";
interface IBaseError {
/**
* Unique identifier of the error.
*/
id: number,
/**
* Error message.
*/
message: string,
/**
* Error to report.
*/
error: Error,
}
export class GenericAxiosError extends Error implements IBaseError {
id: number;
message: string;
error: Error;
constructor(args: IBaseError) {
super();
this.id = args.id;
this.message = args.message;
this.error = args.error;
}
}
export class UnexpectedResponseContentType extends Error implements IBaseError {
id: number;
message: string;
error: Error;
constructor(args: IBaseError) {
super();
this.id = args.id;
this.message = args.message;
this.error = args.error;
}
}
export class InvalidF95Token extends Error {}