dotkom / monoweb

Future version of Online, NTNU's informatics student association's website
https://web.online.ntnu.no/
MIT License
19 stars 2 forks source link

Create central registry for supported error detail types #844

Closed henrikskog closed 8 months ago

henrikskog commented 8 months ago

NOTE: This is a PR against the feat/proper-error-handling branch, used in this pr

Creates a registry for the problem details types the application can return.

Uses detail member for spesific error details instead of title member.

henrikskog commented 8 months ago

I'm not sure I fully agree with the changes here

I think we can give a lot better human readable messages than "Unprocessable Entity" and so on.

With these changes the more spesific messages are given in detail, however each error is wrapped in the adequate generic http error, e.g. "Unrpocessable Entity" for POST requests that do not match validation checks.

I made quite a few changes after your last review. Interested to hear what you think.

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
invoicification ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2024 5:12pm
henrikskog commented 8 months ago

I mean there are many problem details in the file, so I think packages/core/src/http-problem-details.ts is good.