gitfrosh / lotr-api

This repository holds the code base of the API to rule them all, the Lord of the Rings api, which provides you with book, character, movie and quotes data.
https://the-one-api.dev
238 stars 66 forks source link

More consistent error codes and format #114

Closed nortron closed 11 months ago

nortron commented 11 months ago

These 3 commits attempt to make the API more consistent in returning JSON errors with non-2xx HTTP error codes.

The 4th commit updates a code comment to reflect the latest code.

MateuszKikmunter commented 11 months ago

Looks good to me, good idea with a centralized error handler. 👍 One thing though - can you pls change notFoundResponse to be just Not Found instead of Endpoint does not exist.

nortron commented 11 months ago

@MateuszKikmunter No problem, updated to "Not found" with a lowercase "found" to be consistent with the "Something went wrong" capitalization. Happy to make it all caps if you'd prefer that.

MateuszKikmunter commented 11 months ago

@MateuszKikmunter No problem, updated to "Not found" with a lowercase "found" to be consistent with the "Something went wrong" capitalization. Happy to make it all caps if you'd prefer that.

Thanks, looks good to me, now it needs to be approved by @gitfrosh :)