go-adventofcode/aoc_errors.go
Brian Buller 2c48d9b961 Set Cache
Also custom errors
2024-10-24 09:03:49 -05:00

36 lines
630 B
Go

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)
}