go-adventofcode/aoc_errors.go

36 lines
630 B
Go
Raw Normal View History

2024-10-24 14:03:49 +00:00
package aoc
import "fmt"
type SessionRequiredError struct{}
func (e SessionRequiredError) Error() string {
return "session key is required"
}
type SessionError struct{}
func (e SessionError) Error() string {
return "invalid session"
}
type BoardIdRequiredError struct{}
func (e BoardIdRequiredError) Error() string {
return "board id is required"
}
type InvalidYearError struct{}
func (e InvalidYearError) Error() string {
return "invalid year"
}
type LeaderboardNotCachedError struct {
year int
}
func (e LeaderboardNotCachedError) Error() string {
return fmt.Sprintf("leaderboard (%d) is not cached", e.year)
}