plone / guillotina

Python AsyncIO data API to manage billions of resources
https://guillotina.readthedocs.io/en/latest/
Other
187 stars 51 forks source link

Changed error handling logic in ErrorsMiddleware #915

Closed masipcat closed 4 years ago

masipcat commented 4 years ago

Changed error handling logic: Guillotina (asgi app) catches all errors and returns a response for the ones that implements the handler IErrorResponseException. Otherwise raises the exception and is handled by ErrorsMiddleware.

The motivation behind this change is that Sentry middleware was capturing DeserializationErrors and PrecondionFailed exceptions

codecov-io commented 4 years ago

Codecov Report

Merging #915 into master will increase coverage by 0.1%. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #915     +/-   ##
========================================
+ Coverage    94.5%   94.5%   +0.1%     
========================================
  Files         333     333             
  Lines       29407   29416      +9     
========================================
+ Hits        27773   27782      +9     
  Misses       1634    1634
Impacted Files Coverage Δ
guillotina/request.py 87.7% <100%> (ø) :arrow_up:
guillotina/asgi.py 93.2% <100%> (+0.4%) :arrow_up:
guillotina/response.py 88% <100%> (+0.1%) :arrow_up: