Properly handle error and improve error messages

This commit is contained in:
2024-09-21 11:26:25 +07:00
parent 557e7313b2
commit bcdcbd5049
25 changed files with 258 additions and 234 deletions

View File

@ -31,7 +31,6 @@ type SessionInfo struct {
}
type UserStatus string
type SessionNotFoundError struct{}
const (
Authorized UserStatus = "authorized"
@ -40,10 +39,6 @@ const (
Suspicious UserStatus = "suspicious"
)
func (e *SessionNotFoundError) Error() string {
return "session not found"
}
func Get(id string) *Session {
return &Session{ID: id}
}