Skip to content

Commit

Permalink
fixing exception throwing bug
Browse files Browse the repository at this point in the history
where the requestUrl was missing in the response and an exception was thrown internally
  • Loading branch information
FabiKo117 committed Feb 13, 2019
1 parent 0c05575 commit 01eca91
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
@ControllerAdvice
@RestController
public class CustomizedExceptionHandler extends ResponseEntityExceptionHandler {

private String requestUrl = RequestInterceptor.requestUrl;

@ExceptionHandler(BadRequestException.class)
public final ResponseEntity<ErrorDetails> handleBadRequestException(BadRequestException ex) {
Expand Down Expand Up @@ -61,6 +59,7 @@ public final ResponseEntity<ErrorDetails> handleTimeoutException() {
/** Creates the error details based on the thrown exception. */
private ResponseEntity<ErrorDetails> createExceptionResponse(Exception ex, HttpStatus status) {
ErrorDetails errorDetails;
String requestUrl = RequestInterceptor.requestUrl;
if ("No message available".equals(ex.getMessage())) {
if ("null".equals(requestUrl.split("\\?")[1])) {
requestUrl = requestUrl.split("\\?")[0];
Expand Down

0 comments on commit 01eca91

Please sign in to comment.