java.lang.Object
com.erudika.para.core.rest.GenericExceptionMapper
- All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<Exception>
@Provider
public class GenericExceptionMapper
extends Object
implements jakarta.ws.rs.ext.ExceptionMapper<Exception>
Generic exception mapper.
- Author:
- Alex Bogdanovski [[email protected]]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.ws.rs.core.Response
getExceptionResponse
(int status, String msg) Returns an exception/error response as a JSON object.jakarta.ws.rs.core.Response
toResponse
(Exception ex)
-
Constructor Details
-
GenericExceptionMapper
public GenericExceptionMapper()No-args constructor.
-
-
Method Details
-
toResponse
-
getExceptionResponse
Returns an exception/error response as a JSON object.- Parameters:
status
- HTTP status codemsg
- message- Returns:
- a JSON object
-