mysociety / mapit

A web service to map postcodes to administrative boundaries and more
Other
269 stars 88 forks source link

Do not log our own ViewExceptions. #392

Closed dracos closed 2 years ago

dracos commented 2 years ago

Since Django 2.1, all 500s are logged as errors, including ones manually generated by the code. We do not want to receive logged errors for ones we are choosing to generate, so mark the response as already logged with the logger's internal flag.

codecov[bot] commented 2 years ago

Codecov Report

Merging #392 (b5172f6) into master (c447e35) will decrease coverage by 0.06%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #392      +/-   ##
==========================================
- Coverage   71.91%   71.85%   -0.07%     
==========================================
  Files          39       39              
  Lines        2297     2299       +2     
==========================================
  Hits         1652     1652              
- Misses        645      647       +2     
Impacted Files Coverage Δ
mapit/middleware/view_error.py 72.72% <0.00%> (-7.28%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c447e35...b5172f6. Read the comment docs.