HangarMC / Hangar

A plugin repository used for paper plugins
https://hangar.papermc.io/
MIT License
251 stars 64 forks source link

API throws a whitelabel 500 error when a project is not found #1268

Closed Jo0001 closed 1 year ago

Jo0001 commented 1 year ago

Observed/problematic behavior

Plain HTML default error site:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Sep 06 09:04:21 GMT 2023
There was an unexpected error (type=Internal Server Error, status=500).

Expected behavior

Propper 4xx message as JSON like in the /user endpoint

Steps to reproduce

Send a request to the /projects endpoint with a invalid project e.g. with a space in the name like https://hangar.papermc.io/api/v1/projects/ViaVersion%20/versions or https://hangar.papermc.io/api/v1/projects/viaversion%20/members?limit=1&offset=0

On https://hangar.papermc.io/api/v1/projects/viaversion%20/ a 404 is returned but as also as a Whitelabel Error Page instead of a JSON message

Other

No response

MiniDigger commented 1 year ago

Oh that one I might have fixed on my more tests branch already, since I noticed it when writing integration tests