electricity_bill_calc_service/exceptions/auth.go

22 lines
387 B
Go

package exceptions
import "fmt"
type AuthenticationError struct {
Code int16
Message string
NeedReset bool
}
func NewAuthenticationError(code int16, msg string) *AuthenticationError {
return &AuthenticationError{
Code: code,
Message: msg,
NeedReset: false,
}
}
func (e AuthenticationError) Error() string {
return fmt.Sprintf("[%d]%s", e.Code, e.Message)
}