Ivago: invalid parameters also return 404 #11

Open
opened 2021-04-04 15:25:48 +02:00 by Jef Roosens · 2 comments
Owner

When visiting the following URL:

https://fej.roosens.me/ivago?street=Lange+Violettestraat+(GENT)&number=170&start_date=2021-04-04&end_date=2021-04-255

Instead of responding with a Bad Request error, it returns the default 404 handler.

Update:

The problem is now that we don't really have a way to detect wether a route failed because it doesn't exist or because its parameters weren't correct.

When visiting the following URL: `https://fej.roosens.me/ivago?street=Lange+Violettestraat+(GENT)&number=170&start_date=2021-04-04&end_date=2021-04-255` Instead of responding with a Bad Request error, it returns the default 404 handler. Update: The problem is now that we don't really have a way to detect wether a route failed because it doesn't exist or because its parameters weren't correct.
Jef Roosens added this to the (deleted) project 2021-04-04 15:25:48 +02:00
Author
Owner

I just realized this is expected behavior. The real problem here is the fact that the error system isn't specific enough at the moment, so any typo in a parameter results in a 404, instead of a meaningful message.

I just realized this is expected behavior. The real problem here is the fact that the error system isn't specific enough at the moment, so any typo in a parameter results in a 404, instead of a meaningful message.
Jef Roosens changed title from Ivago: invalid parameter errors aren't handled properly to Ivago: invalid parameter also return 404 2021-04-04 19:11:40 +02:00
Jef Roosens removed this from the (deleted) project 2021-04-04 19:12:22 +02:00
Jef Roosens changed title from Ivago: invalid parameter also return 404 to Ivago: invalid parameters also return 404 2021-04-05 10:06:11 +02:00
Author
Owner

I think we can use a fairing to check the error type on response.

I think we can use a fairing to check the error type on response.
Commenting is not possible because the repository is archived.
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Depends on
Reference
Chewing_Bever/fej#11
No description provided.