(errType errorType)
| 2230 | } |
| 2231 | |
| 2232 | func getDefaultErrorCode(errType errorType) int { |
| 2233 | switch errType { |
| 2234 | case errorBadData: |
| 2235 | return http.StatusBadRequest |
| 2236 | case errorExec: |
| 2237 | return http.StatusUnprocessableEntity |
| 2238 | case errorCanceled: |
| 2239 | return statusClientClosedConnection |
| 2240 | case errorTimeout: |
| 2241 | return http.StatusServiceUnavailable |
| 2242 | case errorInternal: |
| 2243 | return http.StatusInternalServerError |
| 2244 | case errorNotFound: |
| 2245 | return http.StatusNotFound |
| 2246 | case errorNotAcceptable: |
| 2247 | return http.StatusNotAcceptable |
| 2248 | default: |
| 2249 | return http.StatusInternalServerError |
| 2250 | } |
| 2251 | } |
| 2252 | |
| 2253 | func parseTimeParam(r *http.Request, paramName string, defaultValue time.Time) (time.Time, error) { |
| 2254 | val := r.FormValue(paramName) |
no outgoing calls
no test coverage detected
searching dependent graphs…