From 23f99112374d675b7e7b1a6f60064a4332bc28e2 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 26 Jul 2019 21:54:13 +0200 Subject: [PATCH] Throw errors when failing to create user --- seasoned_api/src/user/userRepository.js | 1 + 1 file changed, 1 insertion(+) diff --git a/seasoned_api/src/user/userRepository.js b/seasoned_api/src/user/userRepository.js index 2e4ebbd..c2cf6b2 100644 --- a/seasoned_api/src/user/userRepository.js +++ b/seasoned_api/src/user/userRepository.js @@ -26,6 +26,7 @@ class UserRepository { if (error.name === 'AssertionError' || error.message.endsWith('user_name')) { throw new Error('That username is already registered'); } + throw Error(error) }); }