Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 7ca39df0 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

update exception handler

parent bb066846
No related branches found
No related tags found
No related merge requests found
...@@ -14,10 +14,7 @@ ...@@ -14,10 +14,7 @@
package eu.europa.ec.edelivery.smp.error; package eu.europa.ec.edelivery.smp.error;
import ec.services.smp._1.ErrorResponse; import ec.services.smp._1.ErrorResponse;
import eu.europa.ec.edelivery.smp.exceptions.NotFoundException; import eu.europa.ec.edelivery.smp.exceptions.*;
import eu.europa.ec.edelivery.smp.exceptions.UnknownUserException;
import eu.europa.ec.edelivery.smp.exceptions.WrongInputFieldException;
import eu.europa.ec.edelivery.smp.exceptions.XmlParsingException;
import eu.europa.ec.edelivery.smp.error.exceptions.BadRequestException; import eu.europa.ec.edelivery.smp.error.exceptions.BadRequestException;
import eu.europa.ec.smp.api.exceptions.MalformedIdentifierException; import eu.europa.ec.smp.api.exceptions.MalformedIdentifierException;
import eu.europa.ec.smp.api.exceptions.XmlInvalidAgainstSchemaException; import eu.europa.ec.smp.api.exceptions.XmlInvalidAgainstSchemaException;
...@@ -87,6 +84,11 @@ public class ErrorMappingControllerAdvice { ...@@ -87,6 +84,11 @@ public class ErrorMappingControllerAdvice {
return buildAndWarn(BAD_REQUEST, USER_NOT_FOUND, ex.getMessage(), ex); return buildAndWarn(BAD_REQUEST, USER_NOT_FOUND, ex.getMessage(), ex);
} }
@ExceptionHandler(InvalidOwnerException.class)
public ResponseEntity handleUnknownUserException(InvalidOwnerException ex) {
return buildAndWarn(BAD_REQUEST, ErrorBusinessCode.UNAUTHORIZED, ex.getMessage(), ex);
}
@ExceptionHandler(XmlParsingException.class) @ExceptionHandler(XmlParsingException.class)
public ResponseEntity handleXmlParsingException(XmlParsingException ex) { public ResponseEntity handleXmlParsingException(XmlParsingException ex) {
return buildAndWarn(BAD_REQUEST, XSD_INVALID, ex.getMessage(), ex); return buildAndWarn(BAD_REQUEST, XSD_INVALID, ex.getMessage(), ex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment