HTTPStatus returns HTTP status or (-1) for non-HTTP error.
(err error)
| 57 | |
| 58 | // HTTPStatus returns HTTP status or (-1) for non-HTTP error. |
| 59 | func HTTPStatus(err error) int { |
| 60 | if err == nil { |
| 61 | return http.StatusOK |
| 62 | } |
| 63 | if httpErr := cmn.Err2HTTPErr(err); httpErr != nil { |
| 64 | return httpErr.Status |
| 65 | } |
| 66 | return -1 // invalid |
| 67 | } |
| 68 | |
| 69 | func getObjectOptParams(options GetObjectInput) (w io.Writer, q url.Values, hdr http.Header) { |
| 70 | w = io.Discard |