short-d / short

URL shortening service written in Go and React
https://short-d.com
MIT License
869 stars 148 forks source link

[Feature] Handle errors of Search API #865

Open arberiii opened 4 years ago

arberiii commented 4 years ago

What is the problem? In the first version of Search API we are not handling errors and for now, we are just logging them.

Your solution Handle errors correctly and ideally use instrumentation code so that we have a centralized place to organize everything and make changes.

Coteh commented 4 years ago

Hey @arberiii are the changes you made in #882 and #885 sufficient for this issue? Or should more errors be handled?

arberiii commented 4 years ago

Hey @Coteh, thanks for the interest! The search API needs more and better error handling.

First off, errors don't have a custom type, as an example take a look at unknown resource error.

Another issue is that errors are simply logged but not handled, as in here and here. It would be nice to treat them gracefully and have respectively tests, in other words, have test cases that catch those errors.

Coteh commented 4 years ago

I see! I'll do some research and figure out how to best handle these cases. 👍