snok / asgi-correlation-id

Request ID propagation for ASGI apps
MIT License
370 stars 29 forks source link

Add error handling documentation #21

Closed sondrelg closed 2 years ago

sondrelg commented 2 years ago

Closes #19

I fully agree that request IDs can be useful when dealing with unhandled server errors, but on reflection I think building the exception handlers into the framework is redundant. This PR adds (hopefully good enough) documentation to get users started.

Putting these code examples into the package is possible, but from my perspective there are too many ways to write exception handlers to have "one right" handler here, and the user, e.g., in Starlette's case, seems to only be able to map one handler to one status - so in the case where they need two things to happen for the 500-status, they will need to roll their own handler anyways. Documenting how to do it just seems simpler for everyone πŸ‘

codecov[bot] commented 2 years ago

Codecov Report

Merging #21 (4197efb) into main (16733f4) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #21   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          276       276           
=========================================
  Hits           276       276           

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 16733f4...4197efb. Read the comment docs.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information