code: func ErrorToCode(err error) int {
  	switch {
  	case IsAggregate(err):
  		return http.StatusGatewayTimeout
  	case IsNotFound(err):
  		return http.StatusNotFound
  	case IsBadParameter(err) || IsOAuth2(err):
  		return http.StatusBadRequest
  	case IsNotImplemented(err):
  		return http.StatusNotImplemented
  	case IsCompareFailed(err):
  		return http.StatusPreconditionFailed
  	case IsAccessDenied(err):
  		return http.StatusForbidden
  	case IsAlreadyExists(err):
  		return http.StatusConflict
  	case IsLimitExceeded(err):
  		return http.StatusTooManyRequests
  	case IsConnectionProblem(err):
  		return http.StatusGatewayTimeout
  	default:
  		return http.StatusInternalServerError
  	}
  }
docs: // ErrorToCode returns an appropriate HTTP status code based on the provided error type