Error Handling

Learn how to efficiently manage errors when using RaidenX APIs. This guide outlines common error types, explains their possible causes, and provides insights into error response structures. You'll also find practical tips for troubleshooting and resolving issues smoothly.

400 Bad Request

  • Message: "Invalid request parameters or payload."
  • Possible Causes: This error occurs when the request parameters or payload are missing, incorrectly formatted, or invalid. Refer to the API documentation to verify the correct format and required parameters.
  • Example Response:
{
  "success": false,
  "message": "Invalid request parameters or payload."
}

401 Unauthorized

  • Message: "Unauthorized. Authentication required."
  • Possible Causes: This error occurs when authentication credentials are missing or invalid. Ensure that your request includes the correct authentication token or API key in the headers.
  • Example Response:
{
  "success": false,
  "message": "Unauthorized. Authentication required."
}

403 Forbidden

  • Message: "Access Denied. You don't have permission to access this resource."
  • Possible Causes: This error occurs when the user does not have the required permissions to access the requested resource. Verify that your account has the appropriate access privileges.
  • Example Response:
{
  "success": false,
  "message": "Access Denied. You don't have permission to access this resource."
}

422 Unprocessable Entity

  • Message: "Invalid data. Please check the provided data and try again."
  • Possible Causes: This error occurs when the submitted data does not meet the required format or validation rules. Review the API documentation to ensure your request follows the correct structure.
  • Example Response:
{
  "success": false,
  "message": "Invalid data. Please check the provided data and try again."
}

429 Too Many Requests

  • Message: "Too many requests. Please wait and try again later."
  • Possible Causes: This error occurs when the client exceeds the allowed rate limit for API requests. To prevent this, review the API rate limits and ensure your requests adhere to the permitted thresholds.
  • Example Response:
{
  "success": false,
  "message": "Too many requests. Please wait and try again later."
}

500 Internal Server Error

  • Message: "Internal Server Error. Something went wrong on the server."
  • Possible Causes: This error occurs due to an unexpected issue on the server-side, such as a database failure or an unhandled exception. It is typically not caused by the client's request.
  • Example Response:
{
  "success": false,
  "message": "Internal Server Error. Something went wrong on the server."
}

What’s Next