TBB Error Codes
When an error occurs while processing a request on The Bet Brothers Platform, the platform responds with an HTTP error code and a detailed JSON object that describes the specific error encountered. This error object can have different structures depending on the nature of the error.
Example Error Response Structures
1. Errors Containing a Field-Specific Message
In some cases, the errors
field might contain specific fields (such as ip_address
), each with its own array of error messages. This structure is used when multiple validation errors need to be reported, particularly for different fields within the request.
Explanation: In this case, the error message is related to the
ip_address
field. The response indicates that theip_address
field is missing, which is required unless thedemo
flag is set totrue
. Theerrors
object provides a key for the specific field (ip_address
), and the array under it lists all the error messages related to that field.Usage: This format is helpful when different fields in the request might have their own validation rules or when there are multiple issues that need to be addressed. Each field that has an issue will have its own entry in the
errors
object with the corresponding error messages.
2. Errors Containing a General Error Message
In other cases, the errors
field might simply contain a list of general error messages without being tied to a specific field in the request. This format is typically used for higher-level errors or issues that don't relate to a particular input field.
Explanation: In this example, the error message is not related to a specific field, but rather an overarching issue with the request. The message indicates that a particular campaign could not be found. This type of error is more general and does not refer to a specific field, but rather an issue with the request as a whole.
Usage: This format is often used when a resource, such as a campaign, game, or player, cannot be found or does not exist, making it unnecessary to specify which field in the request caused the issue.
Last updated