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.
We pretty much only use
fmt.Errorf
when throwing errors in thebot
package. This makes our rainy-day tests in that package brittle because we only check iferr == 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.