Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide context for Reactive Rest Client exceptions #22103

Merged
merged 1 commit into from
Dec 11, 2021

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Dec 10, 2021

We now add the exact method that caused the exception
in order to make it easier for users to identity where
the exception is coming from

Fixes: #22090

var webApplicationException = (WebApplicationException) res;
var message = webApplicationException.getMessage();
var invokedMethodObject = properties.get(MP_INVOKED_METHOD_PROP);
if ((invokedMethodObject instanceof Method)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double brackets :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Fixed

@michalszynkiewicz
Copy link
Member

that's a really useful thing, thanks @geoand !

@michalszynkiewicz michalszynkiewicz added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 10, 2021
@michalszynkiewicz
Copy link
Member

I think we coudl backport it, WDYT?

@geoand
Copy link
Contributor Author

geoand commented Dec 10, 2021

Yup, very good idea

@geoand geoand added triage/backport-2.5? and removed triage/waiting-for-ci Ready to merge when CI successfully finishes labels Dec 10, 2021
@geoand
Copy link
Contributor Author

geoand commented Dec 10, 2021

@michalszynkiewicz I had to exclude some of the TCK tests because it was asserting the exact exception message

@geoand geoand force-pushed the #22090 branch 2 times, most recently from 11cdafa to 599429c Compare December 10, 2021 14:56
@geoand
Copy link
Contributor Author

geoand commented Dec 10, 2021

I introduced a property for reverting to the spec behavior simply so we can pass the stupid tests...

We now add the exact method that caused the exception
in order to make it easier for users to identity where
the exception is coming from

Fixes: quarkusio#22090
@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 10, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 10, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 903eb34

Status Name Step Failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
✔️ JVM Tests - JDK 17

Full information is available in the Build summary check run.

Failures

⚙️ JVM Tests - JDK 11 Windows #

- Failing: integration-tests/rest-client 

📦 integration-tests/rest-client

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs_java_url line 29 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.trustall.ExternalTlsTrustAllTestCase.restClient line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.wronghost.ExternalWrongHostTestCase.restClient line 22 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

@quarkus-bot
Copy link

quarkus-bot bot commented Dec 11, 2021

Failing Jobs - Building 903eb34

Status Name Step Failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
✔️ JVM Tests - JDK 17

Full information is available in the Build summary check run.

Failures

⚙️ JVM Tests - JDK 11 Windows #

- Failing: extensions/opentelemetry/opentelemetry/deployment 
! Skipped: extensions/opentelemetry/opentelemetry-exporter-jaeger/deployment extensions/opentelemetry/opentelemetry-exporter-otlp/deployment integration-tests/opentelemetry and 2 more

📦 extensions/opentelemetry/opentelemetry/deployment

io.quarkus.opentelemetry.deployment.RestClientOpenTelemetryTest.client line 61 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a lambda expression in io.quarkus.opentelemetry.deployment.TestSpanExporter expected: <2> but was: <1> within 30 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:164)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)

@geoand
Copy link
Contributor Author

geoand commented Dec 11, 2021

@radcortez RestClientOpenTemetry test seems to be pretty flaky. I've seen it fail a few times the last few days

@geoand geoand merged commit ea1a4f6 into quarkusio:main Dec 11, 2021
@quarkus-bot quarkus-bot bot added this to the 2.7 - main milestone Dec 11, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 11, 2021
@radcortez
Copy link
Member

Yes, I've already noticed it too. I'll have a look.

@geoand
Copy link
Contributor Author

geoand commented Dec 13, 2021

Thanks

@gsmet gsmet modified the milestones: 2.7 - main, 2.6.0.Final Dec 13, 2021
@gsmet gsmet modified the milestones: 2.6.0.Final, 2.5.3.Final Dec 14, 2021
@geoand geoand deleted the #22090 branch January 10, 2022 12:50
@gwenneg
Copy link
Member

gwenneg commented Jan 20, 2022

Is there a way to get the old exception message back? I tried quarkus.rest-client.disable-contextual-error-messages=true but it's not working from our app 😢

@gwenneg
Copy link
Member

gwenneg commented Jan 20, 2022

I'm asking because I need the exception message to be unchanged, otherwise it will break something (which could be fixed with an ugly workaround) in our app.

@geoand
Copy link
Contributor Author

geoand commented Jan 20, 2022

For the time being, quarkus.rest-client.disable-contextual-error-messages only works as a system property

@gwenneg
Copy link
Member

gwenneg commented Jan 20, 2022

Thanks! I can disable the new behavior with a System.setProperty instruction at application startup indeed.

It would be great if quarkus.rest-client.disable-contextual-error-messages could become a full-fledged configuration key in a future release.

@geoand
Copy link
Contributor Author

geoand commented Jan 20, 2022

There is #2277 exactly that if someone wants to take it up (maybe @TomasHofman ? ) :)

I thought there was an issue that that tracks the request, but in any case yeah, it should be done.

@gwenneg
Copy link
Member

gwenneg commented Jan 20, 2022

Isn't #22777 tracking it as you initially commented?

@geoand
Copy link
Contributor Author

geoand commented Jan 20, 2022

Right, I got mixed up reading too many issues at the same time...

@TomasHofman
Copy link
Contributor

Now I'm bit confused by the exchange, but I take it nobody is working on making the quarkus.rest-client.disable-contextual-error-messages a configuration property yet. I will try to add it to the config root.

@geoand
Copy link
Contributor Author

geoand commented Jan 20, 2022

Yeah, exactly that @TomasHofman. Sorry for the mixup

@TomasHofman
Copy link
Contributor

No problem, thanks for confirming :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MP Rest Client - meaningless exceptions
6 participants