-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherrors.go
44 lines (30 loc) · 1.88 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package requests
import (
"errors"
)
// ErrUnsupportedContentType is returned when the content type is unsupported.
var ErrUnsupportedContentType = errors.New("unsupported content type")
// ErrUnsupportedDataType is returned when the data type is unsupported.
var ErrUnsupportedDataType = errors.New("unsupported data type")
// ErrEncodingFailed is returned when the encoding fails.
var ErrEncodingFailed = errors.New("encoding failed")
// ErrRequestCreationFailed is returned when the request cannot be created.
var ErrRequestCreationFailed = errors.New("failed to create request")
// ErrResponseReadFailed is returned when the response cannot be read.
var ErrResponseReadFailed = errors.New("failed to read response")
// ErrUnsupportedScheme is returned when the proxy scheme is unsupported.
var ErrUnsupportedScheme = errors.New("unsupported proxy scheme")
// ErrUnsupportedFormFieldsType is returned when the form fields type is unsupported.
var ErrUnsupportedFormFieldsType = errors.New("unsupported form fields type")
// ErrNotSupportSaveMethod is returned when the provided type for saving is not supported.
var ErrNotSupportSaveMethod = errors.New("the provided type for saving is not supported")
// ErrInvalidTransportType is returned when the transport type is invalid.
var ErrInvalidTransportType = errors.New("invalid transport type")
// ErrResponseNil is returned when the response is nil.
var ErrResponseNil = errors.New("response is nil")
// ErrAutoRedirectDisabled is returned when the auto redirect is disabled.
var ErrAutoRedirectDisabled = errors.New("auto redirect disabled")
// ErrTooManyRedirects is returned when the number of redirects is too many.
var ErrTooManyRedirects = errors.New("too many redirects")
// ErrRedirectNotAllowed is returned when the redirect is not allowed.
var ErrRedirectNotAllowed = errors.New("redirect is not allowed as per RedirectSpecifiedDomainPolicy")