Add invalildUsername and invalidUUID errors

This commit is contained in:
danbulant 2020-02-16 17:48:52 +01:00
parent 255a250869
commit 751b1df280
3 changed files with 22 additions and 4 deletions

View file

@ -1,7 +1,7 @@
//Re-exporting for simpler importing
import NotYetImplementedError from './notYetImplemented';
import NotYetImplemented from './notYetImplemented';
import InvalidUsername from './invalidUserName';
import InvalidUUID from './invalidUUID';
export default {
NotYetImplementedError
};
export {NotYetImplemented, InvalidUsername, InvalidUUID};

View file

@ -0,0 +1,9 @@
import Error from './error';
export default class InvalidUUID extends Error {
name = "InvalidUUID";
constructor() {
super("Invalid UUID format");
this.stack = (<any>new Error("Invalid UUID format")).stack;
}
}

View file

@ -0,0 +1,9 @@
import Error from './error';
export default class InvalidUsername extends Error {
name = "InvalidUsername";
constructor() {
super("Invalid username provided");
this.stack = (<any>new Error("Invalid username provided")).stack;
}
}