Skip to main content

errors.go - Overview

  1. Overview This file defines custom error types used within the query service, specifically related to feature availability, user registration, and organization lookup.

  2. Detailed Documentation

ErrFeatureUnavailable

  • Purpose: Represents an error indicating that a specific feature is not available.
  • Parameters:
    • Key (string): The key identifying the unavailable feature.
  • Returns: None
type ErrFeatureUnavailable struct {
Key string
}

Error

  • Purpose: Returns a formatted string describing the feature unavailability error.
  • Parameters: None
  • Returns: string: A string indicating that the feature is unavailable, including the feature key.
func (errFeatureUnavailable ErrFeatureUnavailable) Error() string {
return fmt.Sprintf("feature unavailable: %s", errFeatureUnavailable.Key)
}

ErrEmailRequired

  • Purpose: Represents an error indicating that an email address is required.
  • Parameters: None
  • Returns: None
type ErrEmailRequired struct{}

Error

  • Purpose: Returns a string indicating that an email is required.
  • Parameters: None
  • Returns: string: A static string "email is required".
func (errEmailRequired ErrEmailRequired) Error() string {
return "email is required"
}

ErrPasswordRequired

  • Purpose: Represents an error indicating that a password is required.
  • Parameters: None
  • Returns: None
type ErrPasswordRequired struct{}

Error

  • Purpose: Returns a string indicating that a password is required.
  • Parameters: None
  • Returns: string: A static string "password is required".
func (errPasswordRequired ErrPasswordRequired) Error() string {
return "password is required"
}

ErrSignupFailed

  • Purpose: Represents an error indicating that user registration has failed.
  • Parameters: None
  • Returns: None
type ErrSignupFailed struct{}

Error

  • Purpose: Returns a string indicating that the user signup failed.
  • Parameters: None
  • Returns: string: A static string "failed to register user".
func (errSignupFailed ErrSignupFailed) Error() string {
return "failed to register user"
}

ErrNoOrgFound

  • Purpose: Represents an error indicating that no organization was found.
  • Parameters: None
  • Returns: None
type ErrNoOrgFound struct{}

Error

  • Purpose: Returns a string indicating that no organization was found.
  • Parameters: None
  • Returns: string: A static string "no org found".
func (errNoOrgFound ErrNoOrgFound) Error() string {
return "no org found"
}
  1. Code Examples None

  2. Clarity and Accuracy The documentation accurately reflects the code provided.

  3. Markdown & MDX Perfection The markdown syntax is correct.

  4. Edge Cases To Avoid Breaking MDX All necessary characters are escaped.

  5. Getting Started Relevance Include in Getting Started: NO