-
Notifications
You must be signed in to change notification settings - Fork 144
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
feat(api): test endpoint that throws an exception #919
Conversation
keel-web/src/main/kotlin/com/netflix/spinnaker/keel/rest/TestController.kt
Outdated
Show resolved
Hide resolved
keel-web/src/main/kotlin/com/netflix/spinnaker/keel/rest/TestController.kt
Outdated
Show resolved
Hide resolved
keel-web/src/main/kotlin/com/netflix/spinnaker/keel/rest/TestController.kt
Outdated
Show resolved
Hide resolved
path = ["/error"], | ||
produces = [APPLICATION_JSON_VALUE, APPLICATION_YAML_VALUE] | ||
) | ||
fun throwAnException(): String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be useful to support different types of exceptions/status codes? If so, you could add a parameter with the desired status code and throw an exception you know would cause that code to be returned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it's potentially useful to support simulations of different kinds of errors, and I'd like to hold off on adding this functionality until we have tests that are consuming them (this meets my current testing needs for the exception alerts).
My test is failing because I have to enable the new |
Add a /test/error endpoint that throws an exception (returns 500 error) when hit. This is intended to assist in testing error alerts, by giving us a reliable way to induce errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for addressing our comments.
Add a
/test/error
endpoint that throws an exception (and, consequently, returns a 500 error) when hit.This is intended to assist in testing error alerts, by giving us a reliable way to induce errors.