mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 07:27:43 +00:00
30 lines
682 B
Go
30 lines
682 B
Go
package reddit
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
)
|
|
|
|
type ServerError struct {
|
|
Body string
|
|
StatusCode int
|
|
}
|
|
|
|
func (se ServerError) Error() string {
|
|
return fmt.Sprintf("error from reddit: %d (%s)", se.StatusCode, se.Body)
|
|
}
|
|
|
|
var (
|
|
// ErrOauthRevoked .
|
|
ErrOauthRevoked = errors.New("oauth revoked")
|
|
// ErrTimeout .
|
|
ErrTimeout = errors.New("timeout")
|
|
// ErrRateLimited .
|
|
ErrRateLimited = errors.New("rate limited")
|
|
// ErrRequiresRedditId .
|
|
ErrRequiresRedditId = errors.New("requires reddit id")
|
|
// ErrInvalidBasicAuth .
|
|
ErrInvalidBasicAuth = errors.New("invalid basic auth")
|
|
// ErrTokenAlreadyRefreshed .
|
|
ErrTokenAlreadyRefreshed = errors.New("token already refreshed")
|
|
)
|