-
Notifications
You must be signed in to change notification settings - Fork 572
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
Sending wrong value for key causes ugly stacktrace #5377
Comments
How does the client returned body look like? |
Oh, it's a 503 with the stacktrace. But the formatting is all garbled and it does not really tell a user much. My solution would be to just send the error message and not also send the full stacktrace.
|
AFAIK we agreed to send the stacktrace with new lines inside the error message body, as this sometimes is useful. That was before release 2.4 AFAIK. Still it is not optimal - a proper formatted error message makes sense. Sometimes you'd also need the verbose information. Didn't we introduce "verbose" as global flag somewhere? Could be the reason that this is not always applied, and you'll receive the verbose output all the time. |
Change remote/objectqueryhandler.cpp :: HandleRequest to fix it.
|
Added this to my fix / repo |
Added fix for Icinga#5377
Much better ^_^ |
@Crunsher This was indeed quick and dirty.. :-)
When I check type it always seem to fail, and I'm pretty sure I did the test array wrong but I run aNag on my phone that uses the API and it also fails when I check for type Array or Dict. Is this okay for now? |
I'll pick your fix into a separate PR from #5419 :) Please create separate PRs for different topics next time, your work is much appreciated and it makes our lives easier for reviews 👍 |
|
fixes #5377 Signed-off-by: Michael Friedrich <[email protected]>
When running a query against the API with an existing key but a value of the wrong type, Icinga does not catch the exception but sends it right back at the requestor.
Expected Behavior
A usable error code + message
Current Behavior
From the log, curl returns the stacktrace.
Steps to Reproduce (for bugs)
Run this query against your API
Your Environment
icinga2 --version
):version: v2.6.3-308-gc9039e1
The text was updated successfully, but these errors were encountered: