1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-09-28 21:29:25 +00:00
arikawa/api/errors.go

23 lines
332 B
Go
Raw Normal View History

2020-01-02 05:39:52 +00:00
package api
import (
"fmt"
)
type ErrOverbound struct {
Count int
Max int
Thing string
}
var _ error = (*ErrOverbound)(nil)
func (e ErrOverbound) Error() string {
if e.Thing == "" {
return fmt.Sprintf("Overbound error: %d > %d", e.Count, e.Max)
}
return fmt.Sprintf(e.Thing+" overbound: %d > %d", e.Count, e.Max)
}