keel/net/gotsrpc/errors.go
2021-05-18 08:34:47 +02:00

22 lines
368 B
Go

package gotsrpc
// Error type
type Error string
// Common errors
const (
ErrorNotFound Error = "notFound"
ErrorForbidden Error = "forbidden"
ErrorPermissionDenied Error = "permissionDenied"
)
// NewError returns a pointer error
func NewError(e Error) *Error {
return &e
}
// Error interface
func (e *Error) Error() string {
return string(*e)
}