public enum Metadata{
AC, CD;
@jsonCreator
public static Metadata get(String value) throw customException
if(!isValid(value)){
throw customException();
}
}
My handler method
@ExceptionHandler(customException.class)
public ResponseEntity<Response> handeljsonError(customException e){
return response;
}
when custom exception is thrown from Enum metadata so flow is not coming on custom handler instead of that it is going to httpMessageNonReadableException which is other override method so when I debug its cause its shows ValueInstantiationException.
I want my custom exception method should get run instead of httpMessageNonReadableException