errors/http.go
func (t Type) HTTPStatusCode() int {
	switch t {
	case Canceled:
		return http.StatusRequestTimeout
	case InvalidArgument:
		return http.StatusBadRequest
	case OutOfRange:
		return http.StatusBadRequest
	case NotFound:
		return http.StatusNotFound
	case Conflict:
		return http.StatusConflict
	case AlreadyExists:
		return http.StatusConflict
	case Unauthorized:
		return http.StatusUnauthorized
	case PermissionDenied:
		return http.StatusForbidden
	case Timeout:
		return http.StatusRequestTimeout
	case NotImplemented:
		return http.StatusNotImplemented
	case TemporarilyUnavailable:
		return http.StatusBadGateway
	case PermanentlyUnavailable:
		return http.StatusGone
	case ResourceExhausted:
		return http.StatusForbidden
	case Internal:
		return http.StatusInternalServerError
	case Unknown:
		return http.StatusInternalServerError
	}

	return http.StatusInternalServerError
}
func (t Type) HTTPStatusCode() int {
	switch t {
	case Canceled:
		return http.StatusRequestTimeout
	case InvalidArgument:
		return http.StatusBadRequest
	case OutOfRange:
		return http.StatusBadRequest
	case NotFound:
		return http.StatusNotFound
	case Conflict:
		return http.StatusConflict
	case AlreadyExists:
		return http.StatusConflict
	case Unauthorized:
		return http.StatusUnauthorized
	case PermissionDenied:
		return http.StatusForbidden
	case Timeout:
		return http.StatusRequestTimeout
	case NotImplemented:
		return http.StatusNotImplemented
	case TemporarilyUnavailable:
		return http.StatusBadGateway
	case PermanentlyUnavailable:
		return http.StatusGone
	case ResourceExhausted:
		return http.StatusForbidden
	case Internal:
		return http.StatusInternalServerError
	case Unknown:
		return http.StatusInternalServerError
	}

	return http.StatusInternalServerError
}
// HTTPStatusCode returns the corresponding http status code from an error type