OpenFeign / feign-annotation-error-decoder

Apache License 2.0
51 stars 9 forks source link

[Question] Ignore custom exception constructors at startup #29

Open georgeberar opened 4 years ago

georgeberar commented 4 years ago

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.