Download sdk/cliproxy/auth/errors.go from PHhTTPS/ProxyCLI: direct link, hf CLI and curl.
- Browser
- Download file 879 Bytes
-
https://huggingface.co/spaces/PHhTTPS/ProxyCLI/resolve/main/sdk/cliproxy/auth/errors.go
- Command line
-
hf download hf://spaces/PHhTTPS/ProxyCLI/sdk/cliproxy/auth/errors.go
-
curl -L -o errors.go https://huggingface.co/spaces/PHhTTPS/ProxyCLI/resolve/main/sdk/cliproxy/auth/errors.go
879 Bytes
| package auth | |
| // Error describes an authentication related failure in a provider agnostic format. | |
| type Error struct { | |
| // Code is a short machine readable identifier. | |
| Code string `json:"code,omitempty"` | |
| // Message is a human readable description of the failure. | |
| Message string `json:"message"` | |
| // Retryable indicates whether a retry might fix the issue automatically. | |
| Retryable bool `json:"retryable"` | |
| // HTTPStatus optionally records an HTTP-like status code for the error. | |
| HTTPStatus int `json:"http_status,omitempty"` | |
| } | |
| // Error implements the error interface. | |
| func (e *Error) Error() string { | |
| if e == nil { | |
| return "" | |
| } | |
| if e.Code == "" { | |
| return e.Message | |
| } | |
| return e.Code + ": " + e.Message | |
| } | |
| // StatusCode implements optional status accessor for manager decision making. | |
| func (e *Error) StatusCode() int { | |
| if e == nil { | |
| return 0 | |
| } | |
| return e.HTTPStatus | |
| } | |