API helper method for 400 Bad Request should be more generic
The following discussion from !48265 (merged) should be addressed:
-
@atroschinetz started a discussion: (+3 comments) @shinya.maeda @sabrams this error message seems weird to me. Why is it inserting that "not given" text? I would have expected the error message to be more like:
"400 (Bad request): Date range is too large"Same goes for the test on line 77.
Note there are already many usages of bad_request! that pass it an arbitrary message and don't realize that it adds not given to the end of the message.
Proposal
- Modify
def bad_request!to be usable in more cases than just when a required param is missing. - Adjust usages of
bad_request!where needed