Skip to content
Snippets Groups Projects

NXCALS-2260 - Error in stack trace class name

Merged Marcin Sobieszek requested to merge feature-NXCALS-2260-error-in-stack-trace-class into develop
1 file
+ 3
7
Compare changes
  • Side-by-side
  • Inline
@@ -17,7 +17,6 @@ import javax.validation.ConstraintViolationException;
@Slf4j
public class GlobalControllerExceptionHandler {
@VisibleForTesting
static final String INTERNAL_ERROR_FORMAT = "500 Internal Server Error: %s. Stacktrace: %s";
@VisibleForTesting
@@ -39,7 +38,6 @@ public class GlobalControllerExceptionHandler {
@VisibleForTesting
static final String ILLEGAL_ARGUMENT_ERROR_FORMAT = "409 Illegal Argument: %s. Stacktrace: %s";
@ExceptionHandler(value = { RuntimeException.class })
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public String handleBasicExpression(Exception exception) {
@@ -48,12 +46,11 @@ public class GlobalControllerExceptionHandler {
return String.format(INTERNAL_ERROR_FORMAT, message, Throwables.getStackTraceAsString(exception));
}
@ExceptionHandler(value = { NotFoundRuntimeException.class })
@ResponseStatus(HttpStatus.NOT_FOUND)
public String handleNoContent(NotFoundRuntimeException exception) {
String message = exception.getMessage();
log.warn(message, exception);
log.warn(message);
return String.format(NOT_FOUND_ERROR_FORMAT, message, Throwables.getStackTraceAsString(exception));
}
@@ -65,7 +62,8 @@ public class GlobalControllerExceptionHandler {
return String.format(FORBIDDEN_ERROR_FORMAT, message, Throwables.getStackTraceAsString(exception));
}
@ExceptionHandler(value = { VersionMismatchException.class, OptimisticLockException.class, ConcurrencyFailureException.class })
@ExceptionHandler(value = { VersionMismatchException.class, OptimisticLockException.class,
ConcurrencyFailureException.class })
//This is the closest I could get to say - please repeat this request as another session modified the record.
//CONFLICT means that it cannot be repeated, it is a real conflict forever.
@ResponseStatus(HttpStatus.PRECONDITION_REQUIRED)
@@ -83,7 +81,6 @@ public class GlobalControllerExceptionHandler {
return String.format(CONSTRAINT_VIOLATION_ERROR_FORMAT, message, Throwables.getStackTraceAsString(exception));
}
@ExceptionHandler(value = { ConfigDataConflictException.class })
//This should not be repeated, it is a conflict that stays
@ResponseStatus(HttpStatus.CONFLICT)
@@ -101,5 +98,4 @@ public class GlobalControllerExceptionHandler {
return String.format(ILLEGAL_ARGUMENT_ERROR_FORMAT, message, Throwables.getStackTraceAsString(exception));
}
}
Loading