su-fit-vut / kachna-online

Students' Club U Kachničky: Member's portal
MIT License
5 stars 5 forks source link

Consume 404 errors when appropriate #102

Closed ondryaso closed 1 year ago

ondryaso commented 2 years ago

Currently, the console gets spammed with Failed to load resource: the server responded with a status of 404 in places like the homepage that query endpoints that return HTTP 404 to signalise e.g. that no state of a type is planned (/states/next). These errors are not actually errors and should not be logged to console. This can be achieved by consuming them in the corresponding observable chains in services.

FrNecas commented 1 year ago

This is actually not a bug, our pipelines handle the errors correctly but browsers tend to show 404s in the devtools by default (even if they are handled). This can be filtered: https://stackoverflow.com/questions/4500741/suppress-chrome-failed-to-load-resource-messages-in-console . If we wanted to completely avoid this, we would have to change our API return values, however I don't think that's really worth considering. Closing for now (feel free to re-open)