Skip to content
Snippets Groups Projects

fix: Fix format check in test package

4 unresolved threads
Files
9
/*********************************************************************
* Copyright (c) 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: Zachary Sabourin <zachary.sabourin@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipsefoundation.core.resource.mapper;
import javax.ws.rs.NotAcceptableException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import org.eclipsefoundation.core.model.Error;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Provider
public class NotAcceptableMapper implements ExceptionMapper<NotAcceptableException> {
private static final Logger LOGGER = LoggerFactory.getLogger(NotAcceptableMapper.class);
@Override
public Response toResponse(NotAcceptableException exception) {
LOGGER.error(exception.getMessage(), exception);
return new Error(Status.NOT_ACCEPTABLE, "Could not process the given request: " + exception.getMessage())
.asResponse();
}
}
\ No newline at end of file
Loading