-
Notifications
You must be signed in to change notification settings - Fork 143
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
Don't respond with 400 on ArgumentError #174
Don't respond with 400 on ArgumentError #174
Conversation
If an `ArgumentError` was raised it means that we either did something wrong or we did not handle the request properly and we should respond approriately with a 500.
From @mkanoor : "for AutomateWorkspaces if we got an ID instead of a GUID I wanted to raise an Argument Error" We need to get something from automate to be able to respond accordingly for this (even if it's just... rescuing |
@@ -1,6 +1,7 @@ | |||
module Api | |||
class AutomateWorkspacesController < BaseController | |||
def edit_resource(type, id, data = {}) | |||
raise BadRequestError, "must contain at least one attribute to edit" if data.blank? |
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.
@mkanoor is this the only case from the model that was raising the ArgumentError ?
Checked commit imtayadeway@5b6a866 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
👍 |
one last question Gaprindashvili/yes ? |
@abellotti sorry! Forgot to add. I consider this a bug, so adding Gaprindashvili/yes |
Thanks @imtayadeway. 👍 |
…quest Don't respond with 400 on ArgumentError (cherry picked from commit efe7610)
Gaprindashvili backport details:
|
If an
ArgumentError
was raised it means that we either did somethingwrong or we did not handle the request properly and we should respond
approriately with a 500.
@miq-bot add-label bug
@miq-bot assign @abellotti