Error Handling Recipe#
For the current framework-level error model, start with the guide:
Quick summary:
framework-owned rejections now throw typed HTTP exceptions
RouterKernelcatches them throughErrorHandleryou can override final rendering with
responseRenderercontrollers and user middleware can still return explicit
Responseobjects directly
Use the guide when you need:
API-only JSON error envelopes
browser-friendly HTML errors for non-API paths
preserved headers like
Retry-AfterorAllow