lemeryfertitta / Climbdex

Search engine for training board climbs
https://climbdex.com
MIT License
42 stars 10 forks source link

Show error message on API error #62

Closed lemeryfertitta closed 3 months ago

lemeryfertitta commented 3 months ago

The search results page will seem like its loading when the search API has actually returned an error. For example:

https://climbdex.com/results?minGrade=undefined&maxGrade=undefined&name=&angle=any&minAscents=1&sortBy=ascents&sortOrder=desc&minRating=1.0&onlyClassics=0&gradeAccuracy=1&settername=&holds=&mirroredHolds=&board=kilter&layout=1&size=8&set=1&set=20&roleMatch=strict

It would be more useful if there was an error message, possibly with a link to report the issue here.

brmnjsh commented 3 months ago

PR created adding parameter validations as well as toast messages for errors

@lemeryfertitta Since we're swallowing errors, I wanted to inquire about logging. Do we have a particular location/strategy we'd want to approach this with (logging service and/or local server based)?

lemeryfertitta commented 3 months ago

@brmnjsh thanks for the PR!

Good question about logging. I hadn't really thought about setting up anything robust yet. I think given the very low number of users currently, I'd just stick with outputting to the console, assuming that's what you mean by local server based. I'm able to get the console output in my fly.io dashboard, so I can generally use that for debugging and such. There are probably a few other features that are higher priority to make Climbdex a better drop-in replacement for the existing apps before more robust logging becomes a priority, but it would eventually be a nice thing to have.

brmnjsh commented 3 months ago

@lemeryfertitta alright! I'll log to console for now.

lemeryfertitta commented 3 months ago

Deployed! Thanks again, @brmnjsh