CampaignFlow.Client.Error (CampaignFlow Client v2.0.0)
View SourceError handling for the Campaign Flow API client.
This module defines error types and provides helper functions for working with API errors.
Summary
Functions
Returns true if the error is an authentication error.
Converts an error to a human-readable string.
Creates a new error struct from various error formats.
Returns true if the error is a validation error.
Types
Functions
Returns true if the error is an authentication error.
Converts an error to a human-readable string.
Creates a new error struct from various error formats.
Examples
CampaignFlow.Client.Error.new(:unauthorized)
#=> %CampaignFlow.Client.Error{type: :unauthorized, message: "Unauthorized - authentication failed or token is invalid", status: 401}
CampaignFlow.Client.Error.new({:validation_error, %{"errors" => %{"name" => ["is required"]}}})
#=> %CampaignFlow.Client.Error{type: :validation_error, message: "Validation failed", details: %{"errors" => %{"name" => ["is required"]}}}
Returns true if the error is a validation error.