Skip to content
Snippets Groups Projects

feat: Update RuntimeMapper to return 500 status code

1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
/*********************************************************************
* Copyright (c) 2019 Eclipse Foundation.
* Copyright (c) 2019, 2023 Eclipse Foundation.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
* Zachary Sabourin <zachary.sabourin@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
@@ -21,7 +22,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author martin
* @author Martin, Zachary
*
*/
@Provider
@@ -31,8 +32,7 @@ public class RuntimeMapper implements ExceptionMapper<RuntimeException> {
@Override
public Response toResponse(RuntimeException exception) {
LOGGER.error(exception.getMessage(), exception);
return new Error(Status.BAD_REQUEST, "Error while processing request. Reason: " + exception.getMessage())
.asResponse();
return new Error(Status.INTERNAL_SERVER_ERROR, "Error while processing request. Reason: " + exception.getMessage()).asResponse();
}
}
Loading