errors/http.go
func HTTPStatusToType(status int) Type {
	switch status {
	case http.StatusBadRequest:
		return InvalidArgument
	case http.StatusNotFound:
		return NotFound
	case http.StatusConflict:
		return Conflict
	case http.StatusUnauthorized:
		return Unauthorized
	case http.StatusForbidden:
		return PermissionDenied
	case http.StatusRequestTimeout:
		return Timeout
	case http.StatusNotImplemented:
		return NotImplemented
	case http.StatusBadGateway:
	case http.StatusServiceUnavailable:
		return TemporarilyUnavailable
	case http.StatusGone:
		return PermanentlyUnavailable
	case http.StatusTooManyRequests:
		return ResourceExhausted
	case http.StatusInternalServerError:
		return Unknown
	}
	return Unknown
}
func HTTPStatusToType(status int) Type {
	switch status {
	case http.StatusBadRequest:
		return InvalidArgument
	case http.StatusNotFound:
		return NotFound
	case http.StatusConflict:
		return Conflict
	case http.StatusUnauthorized:
		return Unauthorized
	case http.StatusForbidden:
		return PermissionDenied
	case http.StatusRequestTimeout:
		return Timeout
	case http.StatusNotImplemented:
		return NotImplemented
	case http.StatusBadGateway:
	case http.StatusServiceUnavailable:
		return TemporarilyUnavailable
	case http.StatusGone:
		return PermanentlyUnavailable
	case http.StatusTooManyRequests:
		return ResourceExhausted
	case http.StatusInternalServerError:
		return Unknown
	}
	return Unknown
}
// HTTPStatusToType infers the error Type from a HTTP Status code