diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/data.go | 2 | ||||
| -rw-r--r-- | core/errors.go | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/core/data.go b/core/data.go index 9783c47..a96b56f 100644 --- a/core/data.go +++ b/core/data.go @@ -182,7 +182,7 @@ func decodeString(buf io.Reader, ptr *string) error { func ReadAddr(addr string) (string, string, error) { channel, host, ok := strings.Cut(addr, "@") if !ok { - return "", "", fmt.Errorf("invalid address") + return "", "", ErrInvalidAddress } return channel, host, nil diff --git a/core/errors.go b/core/errors.go new file mode 100644 index 0000000..a50fbf7 --- /dev/null +++ b/core/errors.go @@ -0,0 +1,12 @@ +package core + +import "errors" + +var ( + ErrUnexpectedPayloadType = errors.New("unexpected payload type") + ErrAuthInvalidUser = errors.New("invalid user") + ErrAuthInvalidPassword = errors.New("invalid password") + ErrInvalidAddress = errors.New("invalid address") + ErrNotSupported = errors.New("not supported") + ErrDisconnected = errors.New("disconnected") +) |
