RestExcepction
The main exception class thrown by the Akatus SDK when API requests fail. Namespace:Akatus
Inheritance: System.Exception
Properties
The HTTP status code returned by the API
The HTTP status description
Note: The property name contains a typo (“Desciption” instead of “Description”) in the SDK source code
A list of error messages returned by the API. If the API returns XML error responses, the messages are parsed from the
<descricao> tags. Otherwise, the raw error message is included.Constructor
errorMessage- The error message or XML response from the APIstatusCode- The HTTP status codestatusDesciption- The HTTP status description
Error Handling Pattern
When making API calls with the Akatus SDK, wrap your code in a try-catch block to handle potential errors:Common Scenarios
API Authentication Errors
API Authentication Errors
If your API key or token is invalid, you’ll receive a
RestExcepction with a 401 or 403 status code. Check your configuration:Validation Errors
Validation Errors
Missing or invalid transaction data will result in a
RestExcepction with a 400 status code. The ErrorMessages list will contain specific validation failures.Network Errors
Network Errors
Network connectivity issues may result in other exception types. Always include a general
catch (Exception ex) block to handle unexpected errors.