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
improve exception details when karate.call fails in js script #2216
Comments
this is low priority for us, anyone is welcome to contribute a PR |
I did some homework and seems this is the class tha would need change: karate/karate-core/src/main/java/com/intuit/karate/core/Result.java Lines 139 to 150 in 4257ec4
Change>>
Output >>>> |
@shrik18 that code has evolved over 6 years to keep the logs free of noise. I think getCause() can return null in some cases. anyway, a PR and thorough testing (and observation) is required. |
@ptrthomas agreed due diligence is required and indeed getCause() possibly can return null. karate/karate-core/src/main/java/com/intuit/karate/core/ScenarioEngine.java Lines 594 to 612 in 4257ec4
Line 611 : this is where actual exception is added to cause. I can ammend this to This way we are pretty much sure only http failures exceptions are added to message, and no risk of null pointer Its up to you to choose the solution and I will raise a PR. |
@shrik18 yes that sounds good |
Added http exception message to karate exception so it appears in Result as well karatelabs#2216
1.4.0 released |
today when karate.call is made using js function it throws generic exception with no details
[print] exception>>> com.intuit.karate.KarateException: http call failed after 4519 milliseconds for url: https://localhost:8080/abcd/xyz/3.1
classpath:com/intuit/karate/test/js-test-abstract.feature:15
The actual exception is suppressed
19:33:57.062 [main] ERROR com.intuit.karate - javax.net.ssl.SSLException: Unsupported or unrecognized SSL message, http call failed after 425 milliseconds for url: https://localhost:8080/abcd/xyz/3.1
It will help adding these details to serve odd cases like https://stackoverflow.com/questions/55095314/
The text was updated successfully, but these errors were encountered: