PaystackError class

Custom exception class for Paystack payment errors.

This class represents errors that occur during Paystack API interactions. It provides structured error information including error codes and additional details.

Properties

  • message: Human-readable error description
  • code: Optional error code from Paystack API
  • details: Optional additional error details from the API response

Example

try {
  final response = await AllPaystackPayments.initializeCardPayment(...);
} on PaystackError catch (e) {
  print('Paystack Error: ${e.message}');
  if (e.code != null) {
    print('Error Code: ${e.code}');
  }
  // Handle specific error types
}
Implemented types

Constructors

PaystackError.new({required String message, String? code, Map<String, dynamic>? details})
PaystackError.fromApiResponse(Map<String, dynamic> response)
Factory method to create error from API response.
factory

Properties

code String?
Error code from Paystack API
final
details Map<String, dynamic>?
Additional error details
final
hashCode int
The hash code for this object.
no setterinherited
message String
Error message
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited