Added getter functions to Error

This commit is contained in:
Sasha Koshka 2022-08-18 00:39:08 -04:00
parent dd8bbf8b13
commit 57f02ad6f6
1 changed files with 10 additions and 0 deletions

View File

@ -87,3 +87,13 @@ func (err Error) Error () (formattedMessage string) {
func (err Error) Print () {
os.Stderr.Write([]byte(err.Error()))
}
// Message returns the error's message string
func (err Error) Message () (message string) {
return err.message
}
// Kind returns what kind of error the error is.
func (err Error) Kind () (kind ErrorKind) {
return err.kind
}