feign-annotation-error-decoder icon indicating copy to clipboard operation
feign-annotation-error-decoder copied to clipboard

[Question] Ignore custom exception constructors at startup

Open georgeberar opened this issue 5 years ago • 0 comments

Version 1.3.0

Problem Hi, I'm using the @FeignExceptionConstructor with a custom exception like: @FeignExceptionConstructor public ExternalApiException(final Response response) { if(response != null){ // extract info from response log.error(...) // print the status, body and other stuff extracted from response }
}

I know in your documentation is specified that

It's worth noting that at setup/startup time, the generators are checked with a null value of the body. If you don't do the null-checker, you'll get an NPE and startup will fail.

but this is annoying because the response will not be null and it will print multiple ERROR messages into logs when the app starts due to the 'generators checking' and they are not really errors.

Question Is there a way of disabling this checking? Is this checking of constructors mandatory? I just don't want to fill the logs with error messages (that are not really error messages) because of it.

Thank you.

georgeberar avatar Jan 21 '20 14:01 georgeberar