-
Notifications
You must be signed in to change notification settings - Fork 811
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
fix(exceptions): add exception handler for exceptional situations #3845
fix(exceptions): add exception handler for exceptional situations #3845
Conversation
@@ -478,4 +480,11 @@ class OperationsController { | |||
pipeline.origin = AuthenticatedRequest.spinnakerUserOrigin.orElse('unknown') | |||
} | |||
} | |||
|
|||
@ExceptionHandler(UserException.class) | |||
static void handleUserExceptions(UserException e, HttpServletResponse response) { |
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.
do our generic error handlers in kork not handle UserException as a 400 already?
I think if they do, they will serve a json payload with some details instead of a text response - might play slightly nicer with handling API responses if they come back that way
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.
oh... i didn't see it let me look/try, thanks!
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.
doesn't look like it, but i can add one to kork, that will obviate the need for them here
https://github.com/spinnaker/kork/pull/737/files will update this PR |
When a user submits a bad pipeline e.g. * with jenkins trigger that has an invalid properties file or job that doesn't exist) * with a broken pipeline template we don't want to 500 because: a) the calling service (echo in most cases here) will keep retrying which makes no sense b) it's an erroneous HTTP 500 metric that is noise
c37251e
to
87dab93
Compare
1. Don't log task failures on `UserException` 2. Don't fail retrieving properties file if the build wasn't started
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 with kork fix
…innaker#3845) * fix(exceptions): add exceptionhandler for non-excpetional situations When a user submits a bad pipeline e.g. * with jenkins trigger that has an invalid properties file or job that doesn't exist) * with a broken pipeline template we don't want to 500 because: a) the calling service (echo in most cases here) will keep retrying which makes no sense b) it's an erroneous HTTP 500 metric that is noise * fix(exceptions): fix various exception issues 1. Don't log task failures on `UserException` 2. Don't fail retrieving properties file if the build wasn't started * fixup! Merge branch 'master' into mark/exceptionhandlers Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
When a user submits a bad pipeline e.g.
we don't want to 500 because:
a) the calling service (echo in most cases here) will keep retrying which makes no sense
b) it's an erroneous HTTP 500 metric that is noise