quintilesims / slackbot

Slack bot for IQVIA
MIT License
2 stars 0 forks source link

Use custom error type to denote expected vs. unexpected errors #54

Open zpatrick opened 6 years ago

zpatrick commented 6 years ago

We pretty much only use fmt.Errorf when throwing errors in the bot package. This makes our rainy-day tests in that package brittle because we only check if err == nil. We should return a custom error type if we encounter expected errors (typically, bad user input) and update our rainy-day tests to check for that specific error type.

Also, we could potentially update main to avoid logging errors that are from bad user input.