Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More helpful error messages #1

Open
jaredhasenklein opened this issue Aug 24, 2018 · 1 comment
Open

More helpful error messages #1

jaredhasenklein opened this issue Aug 24, 2018 · 1 comment

Comments

@jaredhasenklein
Copy link
Contributor

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.

@Eiim
Copy link
Owner

Eiim commented Aug 24, 2018

Agreed, better error messages will be something of a longer-term project due to the wide variety of things that can go wrong (key, event is n/a, team is n/a, team is not at event, etc.) This will be important to implement soon enough though.

Eiim pushed a commit that referenced this issue Oct 26, 2018
Added official events logic and optional parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants