diff options
author | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-30 20:48:22 -0400 |
---|---|---|
committer | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-30 20:48:22 -0400 |
commit | 197be103d02db808b0e6bf8a1d1369e3d7928c03 (patch) | |
tree | ec9233147ecce35defea8cd85290f9232201c6c0 /ufund-api/src/main/java/com/ufund/api/ufundapi/controller/AuthController.java | |
parent | b29f29eca643648381bfb62a4b90ad29e17f48a7 (diff) | |
download | JellySolutions-197be103d02db808b0e6bf8a1d1369e3d7928c03.tar.gz JellySolutions-197be103d02db808b0e6bf8a1d1369e3d7928c03.tar.bz2 JellySolutions-197be103d02db808b0e6bf8a1d1369e3d7928c03.zip |
Modified controllers to return error text when catching errors. Also added additional error checking to CupboardService for physical needs.
Diffstat (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/controller/AuthController.java')
-rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/controller/AuthController.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/AuthController.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/AuthController.java index aa99a90..82b2c67 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/AuthController.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/AuthController.java @@ -43,10 +43,10 @@ public class AuthController { return new ResponseEntity<>(key, HttpStatus.OK); } catch (IllegalAccessException ex) { LOG.log(Level.WARNING, ex.getLocalizedMessage()); - return new ResponseEntity<>(HttpStatus.UNAUTHORIZED); + return new ResponseEntity<>(ex.getMessage(), HttpStatus.UNAUTHORIZED); } catch (IOException ex) { LOG.log(Level.SEVERE, ex.getLocalizedMessage()); - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + return new ResponseEntity<>(ex.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } } @@ -64,7 +64,7 @@ public class AuthController { return new ResponseEntity<>(HttpStatus.OK); } catch (IOException ex) { LOG.log(Level.WARNING, ex.getLocalizedMessage()); - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + return new ResponseEntity<>(ex.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } } } |