summaryrefslogtreecommitdiff
path: root/graphs/js/accountConstraints/accountError.js
diff options
context:
space:
mode:
Diffstat (limited to 'graphs/js/accountConstraints/accountError.js')
-rw-r--r--graphs/js/accountConstraints/accountError.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/graphs/js/accountConstraints/accountError.js b/graphs/js/accountConstraints/accountError.js
new file mode 100644
index 0000000..9b427e0
--- /dev/null
+++ b/graphs/js/accountConstraints/accountError.js
@@ -0,0 +1,23 @@
+class InvalidUsernameError extends Error {
+ name = "InvalidUsernameError";
+ constructor(message) {
+ super("Invalid username: " + message);
+ }
+}
+class InvalidPasswordError extends Error {
+ name = "InvalidPasswordError";
+ constructor(message) {
+ super("Invalid password: " + message);
+ }
+}
+class InvalidYearOfBirthError extends Error {
+ name = "InvalidYearOfBirthError";
+ constructor(message) {
+ super("Invalid birth year: " + message);
+ }
+}
+module.exports = {
+ InvalidPasswordError,
+ InvalidUsernameError,
+ InvalidYearOfBirthError,
+};