-
Notifications
You must be signed in to change notification settings - Fork 3
More helpful error messages #1
Description
Summary
I would appreciate more helpful error messages if possible.
Example & End result
For example, entering =TBATeamEventMatchKeys("1836","2018cabl") returns a #REF error with the explanation Reference does not exist. The reason why it does not yet exist is because frc1836 does not have any matches for 2018cabl yet. An error like Team 1836 does not have any matches at Beach Blitz 2018 would be a lot more informative.
Further enhancement
To go a step further, it would be nice if the sheet could check against the API to see if that error will ever be resolved. By this I mean: using the last example, 1836 is competing at 2018cabl but there are not yet any matches for the event. However, if I entered =TBATeamEventMatchKeys("1836","2018cc"), I would currently get the same #REF error (or I would get Team 1836 does not have any matches at Chezy Champs 2018 under my suggested model). However, 1836 is not competing at 2018cc so there will never be any matches listed.
Proposed solution
Custom error messages
Custom errors are supported in Google Script and can be implemented per these guidelines.
In practice
In actuality, it is tricky to know when to serve the error, simply because the TBA API will just return null when there is no information to be relayed. Going back to the same example, both .../team/frc1836/event/2018cabl/status and .../team/frc1836/event/2018cc/status will return null which is just not that helpful. So, some additional logic would need to be worked out.