diff --git a/client/src/errors/index.ts b/client/src/errors/index.ts index fb0d647..62a25ee 100644 --- a/client/src/errors/index.ts +++ b/client/src/errors/index.ts @@ -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 -}; \ No newline at end of file +export {NotYetImplemented, InvalidUsername, InvalidUUID}; \ No newline at end of file diff --git a/client/src/errors/invalidUUID.ts b/client/src/errors/invalidUUID.ts new file mode 100644 index 0000000..34d64c5 --- /dev/null +++ b/client/src/errors/invalidUUID.ts @@ -0,0 +1,9 @@ +import Error from './error'; + +export default class InvalidUUID extends Error { + name = "InvalidUUID"; + constructor() { + super("Invalid UUID format"); + this.stack = (new Error("Invalid UUID format")).stack; + } +} \ No newline at end of file diff --git a/client/src/errors/invalidUsername.ts b/client/src/errors/invalidUsername.ts new file mode 100644 index 0000000..1b5746b --- /dev/null +++ b/client/src/errors/invalidUsername.ts @@ -0,0 +1,9 @@ +import Error from './error'; + +export default class InvalidUsername extends Error { + name = "InvalidUsername"; + constructor() { + super("Invalid username provided"); + this.stack = (new Error("Invalid username provided")).stack; + } +} \ No newline at end of file