Error Handling & Error Codes

At BHN we prioritize robust error handling to ensure developers have a smooth experience integrating with our APIs. Here's how we handle errors in our developer portal:

  1. Consistent Error Response Format: BHN maintain a consistent error response format across all API endpoints. This consistency helps developers easily identify and troubleshoot errors. Its recommended to code to error codes vs error message, as the error messages gets updated in order to provide more detail for troubleshooting. Please Error codes for detail.

  2. HTTP Status Codes: BHN uses appropriate HTTP status codes to indicate the nature of the error. For example, we use 4xx status codes for client errors (e.g., 400 Bad Request) and 5xx status codes for server errors (e.g., 500 Internal Server Error), ensuring clear communication with developers.

  3. Informative Error Messages: BHN provide clear and informative error messages that explain the cause of the error and suggest potential solutions.

  4. Retry Strategies: BHN recommend appropriate retry strategies for handling transient errors, such as network timeouts or temporary service disruptions.