Problem/Motivation
In the dblog rest plugin, a message is given to the HttpException constructor, but the constructor actually takes a HTTP status code as the first parameter. This means that clients get an incorrect HTTP status code and no message explaining the situation.
The remaining uses of HttpException in core seem to be correctly used.
Proposed resolution
Fix the parameters; send a generic 400 status code.
Remaining tasks
Probably needs tests.
Needs review.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | interdiff-2512668-7-9.txt | 842 bytes | martin107 |
| #9 | 2512668-9.patch | 2.34 KB | martin107 |
| #7 | 2512668-7.patch | 1.82 KB | MattA |
Comments
Comment #1
MattA commentedComment #2
dawehnerWhat about using BadRequestHttpException directly?
Comment #3
MattA commentedExact same result, and I guess slightly more informative for developers?
Comment #4
MattA commentedNow with an easier than expected test.
Comment #5
MattA commentedMessed up encoding in patch file.
Comment #7
MattA commented...and Windows sucks.
Comment #8
MattA commentedComment #9
martin107 commentedIn terms of review +1 from me ... the thrust of the argument is correct.
My patch fixes only a small nit ... the throwing of exceptions is not documented.
Comment #10
dawehnerThat seems indeed more semantically correct
Comment #11
catchCommitted/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!