mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-09-28 21:29:25 +00:00
23 lines
332 B
Go
23 lines
332 B
Go
|
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)
|
||
|
}
|