mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Initial commit
This commit is contained in:
commit
5f1d811c66
23 changed files with 3612 additions and 0 deletions
21
error.go
Normal file
21
error.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package crunchyroll
|
||||
|
||||
import "fmt"
|
||||
|
||||
// AccessError is an error which will be returned when some special sort of api request fails.
|
||||
// See Crunchyroll.request when the error gets used
|
||||
type AccessError struct {
|
||||
error
|
||||
|
||||
URL string
|
||||
Body []byte
|
||||
Message string
|
||||
}
|
||||
|
||||
func (ae *AccessError) Error() string {
|
||||
if ae.Message == "" {
|
||||
return fmt.Sprintf("Access token invalid for url %s\nBody: %s", ae.URL, string(ae.Body))
|
||||
} else {
|
||||
return ae.Message
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue