Handle wrong status/outcome gracefully
ClosedPublic

Authored by jskladan on May 6 2015, 9:05 AM.

Details

Summary

Instead of failing with Internal Server Error, return JSON formated
error message for queries containing unknown/unsupported status/outcome
like: http://.../resultsdb_api/api/v1.0/results?outcome=BADOUTCOME

Test Plan

Unittests

Diff Detail

Repository
rRSDB resultsdb
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jskladan retitled this revision from to Handle wrong status/outcome gracefully.May 6 2015, 9:05 AM
jskladan updated this object.
jskladan edited the test plan for this revision. (Show Details)
jskladan added reviewers: kparal, tflink, mkrizek.
kparal added inline comments.May 6 2015, 9:47 AM
resultsdb/controllers/api_v1.py
412

Shouldn't a return retval be here?

tflink accepted this revision.May 6 2015, 4:20 PM
This revision is now accepted and ready to land.May 6 2015, 4:20 PM
tflink requested changes to this revision.May 7 2015, 3:15 AM

bah, I completely missed what @kparal pointed out. review fail for me today :-/

This revision now requires changes to proceed.May 7 2015, 3:15 AM
jskladan added inline comments.May 7 2015, 7:09 AM
resultsdb/controllers/api_v1.py
412

Well, yes, it probably makes sense to add it there. Not really absolutely necessary, as the error will be caught anyway, but we at least won't do unnecessary steps in the code.

Good catch, thanks!

jskladan updated this revision to Diff 978.May 7 2015, 7:10 AM
  • Fixed according to review
kparal accepted this revision.May 7 2015, 9:58 AM
Closed by commit rRSDB38c89bb0f107: Handle wrong status/outcome gracefully (authored by Josef Skladanka <jskladan@redhat.com>). · Explain WhyMay 7 2015, 1:32 PM
This revision was automatically updated to reflect the committed changes.