aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/AuthController.java
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-03-30 20:48:22 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-03-30 20:48:22 -0400
commit197be103d02db808b0e6bf8a1d1369e3d7928c03 (patch)
treeec9233147ecce35defea8cd85290f9232201c6c0 /ufund-api/src/main/java/com/ufund/api/ufundapi/controller/AuthController.java
parentb29f29eca643648381bfb62a4b90ad29e17f48a7 (diff)
downloadJellySolutions-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.java6
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);
}
}
}