harvard-lil / h2o

H2O is a web app for creating and reading open educational resources, primarily in the legal field
https://opencasebook.org
GNU Affero General Public License v3.0
35 stars 30 forks source link

Suppress error for non-UUID in image route #2043

Closed bensteinberg closed 5 months ago

bensteinberg commented 5 months ago

This suppresses errors that occur when someone tries to get routes like /image/png, which should 404 instead. The slightly non-idiomatic use of the assertion is in order to have the same effect in the dev environment as in deployments; a bare try-except does not catch the error in dev, where I think the storage abstraction behaves differently -- the error just looks like

Traceback:

File "" in
codecov-commenter commented 5 months ago

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 76.92%. Comparing base (1288304) to head (c3c883e). Report is 5 commits behind head on develop.

Files Patch % Lines
web/main/views.py 0.00% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #2043 +/- ## =========================================== + Coverage 76.59% 76.92% +0.33% =========================================== Files 64 60 -4 Lines 7100 6995 -105 =========================================== - Hits 5438 5381 -57 + Misses 1662 1614 -48 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.