Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.42 KB

error_handling.md

File metadata and controls

33 lines (25 loc) · 1.42 KB

Error Handling

  1. AuthenticationError:

    • Purpose: Represents an error related to authentication.
    • Fields:
      • Message: Provides additional information about the error.
  2. APIError:

    • Purpose: Represents an error related to API calls.
    • Fields:
      • Message: Provides additional information about the error.
      • Code: Specifies the error code associated with the API error.
  3. SerializationError:

    • Purpose: Represents an error related to serialization.
    • Fields:
      • Message: Provides additional information about the error.
  4. SDKError:

    • Purpose: Represents a general SDK error.
    • Fields:
      • Message: Provides additional information about the error.
  5. RequestError:

    • Purpose: Represents an error related to making an authentication request.
    • Fields:
      • Message: Provides additional information about the error.

Each error type has an associated Error() method that returns a formatted error message based on the error type and the provided error message. Additionally, there are corresponding New functions that create and return an error instance with the specified error message.

To use these error types, you can import the error package and utilize the respective New functions to create specific error instances when necessary.

Please note that it's important to handle and propagate errors appropriately in your code to ensure proper error handling and debugging.