Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Changed Controllers to return response status exception (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschulte-tsi authored Oct 14, 2021
1 parent 716d309 commit ec8af1c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ public ResponseEntity<QuickTestArchiveResponseList> findArchivesByTestResultAndU
response.setQuickTestArchives(quickTestArchiveResponses);
log.info("quicktest found successfully.");
return ResponseEntity.ok(response);
} catch (ResponseStatusException e) {
throw e;
} catch (Exception e) {
log.debug("Couldn't execute findArchivesByTestResultAndUpdatedAtBetween."
+ " Message: {}", e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public ResponseEntity<QuickTestResponseList> getQuickTestsForTenantIdAndPocId()
QuickTestResponseList response = new QuickTestResponseList();
response.setQuickTests(quickTests);
return ResponseEntity.ok(response);
} catch (ResponseStatusException e) {
log.debug("Respondstatus error information getQuickTests: ", e);
throw e;
} catch (Exception e) {
log.error("Failed to find pending quicktests");
log.debug("Extended error information getQuickTests: ", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public ResponseEntity<QuickTestStatisticsResponse> getQuicktestStatistics(
quickTestStatisticsService.getStatistics(utilities.getIdsFromToken(), utcDateFrom, utcDateTo),
QuickTestStatisticsResponse.class);
return ResponseEntity.ok(quickTestStatisticsResponse);
} catch (ResponseStatusException e) {
throw e;
} catch (Exception e) {
log.error("Couldn't execute getQuicktestStatistics.");
throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR);
Expand Down

0 comments on commit ec8af1c

Please sign in to comment.