gov.nasa.pds.api.registry.controllers.RegistryApiResponseEntityExceptionHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of registry-api-service Show documentation
Show all versions of registry-api-service Show documentation
Registry API Service contributing to the PDS Federated Search API
package gov.nasa.pds.api.registry.controllers;
import java.util.Set;
import gov.nasa.pds.api.registry.configuration.WebMVCConfig;
import gov.nasa.pds.api.registry.model.exceptions.*;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
@ControllerAdvice
public class RegistryApiResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {
private String errorDisclaimerHeader = "An error occured.\n";
private String errorDisclaimerFooter =
"For assistance, forward this error message to [email protected]";
// TODO refactor code to avoid repeating oneself.
private ResponseEntity