package br.gov.servicos.editor.frontend;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.client.ResourceAccessException;
import java.io.FileNotFoundException;
@ControllerAdvice
class ErrosHttp {
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(FileNotFoundException.class)
public void fileNotFound() {
}
@ResponseStatus(HttpStatus.OK)
@ResponseBody
@ExceptionHandler(ResourceAccessException.class)
public String erroAoDelegarParaApiExterna() {
return "[]";
}
}