Skip to content
This repository was archived by the owner on Dec 21, 2019. It is now read-only.
This repository was archived by the owner on Dec 21, 2019. It is now read-only.

Update error handling to use exported error types instead of relying on checking the string #31

@flexd

Description

@flexd

Checking the string is a very bad idea, and it is a much better idea to create exported error types, such as ErrorAlreadyAuthenticated that we can check for instead of relying on checking the string contents of err.Error(). err.Error() is for the user to read, not the machines.

http://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully is a good read detailing how it's best to go about this. :-)

He is also involved in a package that follows the rules he suggests in the blogpost https://github.com/pkg/errors

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions