class UnsupportedDataSourceExceptionMapper implements ExceptionMapper<UnsupportedDataSourceException> {

    @Override
    public Response toResponse(UnsupportedDataSourceException exception) {
        Response.Status status = Response.Status.NOT_ACCEPTABLE;
        return Response.status(status).entity(new ErrorDescriptor().setErrorCode("data.source.type.not.supported").setMessage(exception.getMessage())).build();
    }

}