Enums (result codes, flags…)

This commit is contained in:
Nuno Cruces
2023-01-16 12:54:24 +00:00
parent 1366541e77
commit c480512001
7 changed files with 183 additions and 41 deletions

View File

@@ -6,8 +6,8 @@ import (
)
type Error struct {
Code int
ExtendedCode int
Code ErrorCode
ExtendedCode ExtendedErrorCode
str string
msg string
}
@@ -19,7 +19,7 @@ func (e Error) Error() string {
if e.str != "" {
b.WriteString(e.str)
} else {
b.WriteString(strconv.Itoa(e.Code))
b.WriteString(strconv.Itoa(int(e.Code)))
}
if e.msg != "" {