Error Handling

Error Handling

Requests made to the Roanuz Cricket API server can sometimes result in errors. These errors are of different kinds, and are communicated through the “error” object in the response. The errors are classified in a relevant and self-explanatory manner.

HTTP Status Codes

The HTTP response status codes indicate if a specific HTTP request has been completed successfully. The responses can be usually classified into five categories:
100-199 Informational responses
200-299 Successful responses
300-399 Redirects
400-499 Client errors
500-599 Server errors
For a comprehensive list of Status codes, visit HTTP response status codes - MDN web docs.

Common Errors:

Some of the error codes you might run into while using the endpoints and ways to resolve them.
HTTP Status 400
Error Code A-400-0
Reason Invalid input to process
This usually happens when some or all of your inputs are wrong while trying to process a request. For example, the Match Key that you have mentioned in the request URL of Match API might be wrong. To avoid this error, make sure you have enclosed the correct inputs before sending the request.
HTTP Status 400
Error Code A-400-2
Reason Invalid Project Key provided
This usually occurs when you have specified the wrong Project Key in the request while requesting data. To avoid this, make sure you have entered the correct Project key from the console while calling the endpoint.
HTTP Status 400
Error Code A-400-3
Reason Invalid Page Key provided
This error is thrown when the wrong page key is included in the endpoint call while navigating between pages of a response. To fix this error, look upon the correct page_key in the response of the current page and include it in the endpoint call.
HTTP Status 401
Error Code A-401-0
Reason Invalid access token to process
This usually happens when you are trying to access the resources with a token that has already expired. To fix this error, authenticate and generate a new token with the Authentication API.
HTTP Status 402
Error Code A-402-0
Reason Project is inactive
This usually happens when your project isn’t part of an active Roanuz Sports subscription. To fix this error, renew your subscription to Roanuz Sports.
HTTP Status 403
Error Code A-403-0
Reason Access is limited to specific user groups
This usually happens when you are trying to access an endpoint that is not available for your current subscription plan, or if you have exceeded the number of accesses or free requests allowed in your plan. If this happens frequently, consider upgrading your subscription plan.
HTTP Status 404
Error Code A-404-0
Reason Resource not found
This error is thrown when the data requested by the client is either not accessible or has been removed from the database. When this happens, make sure the resource you’re trying to access actually exists. If it does, contact the Roanuz support team.
HTTP Status 500
Error Code UN-500-0
Reason Unknown error
Under unpredictable circumstances, due to internal issues, the server might throw unknown errors for a very brief period. When this happens, retry the same request after a few seconds.

Authentication API errors

A few error codes that are specific to the Authentication API endpoint and how to resolve them.
HTTP Status 400
Error Code A-400-4
Reason Invalid API Key provided
This usually occurs when you have specified the wrong API Key in the Body while requesting Authentication. To fix this error, look upon the correct API key from the console and include it in the endpoint call.

Associations by Country API errors

The following error code is specific to the Associations by Country API endpoint.
HTTP Status 400
Error Code C-400-1
Reason Invalid country code provided
This error occurs when you have specified a wrong country code while accessing data with the Associations by Country API endpoint. To fix this error, include the correct country code in the endpoint call and retry the request.

Subscription Endpoint Errors:

A few error codes that are specific to the Subscription API endpoints and how to resolve them.
HTTP Status 400
Error Code P-400-1
Reason Subscription not configured on your project for the requested delivery method
This error occurs when you have not subscribed to the push delivery services for the expected delivery method. When this happens, subscribe to the required data delivery service using the Subscription API.
HTTP Status 400
Error Code P-400-2
Reason Invalid push delivery method
This error occurs when the push delivery method you requested doesn’t exist. When this happens, check if you have specified the correct delivery method and try again.
HTTP Status 400
Error Code P-400-3
Reason Subscription not supported for the requested delivery method
This error occurs when the push delivery method you have mentioned is not available for the requested resource. When this happens, please include a delivery method that is supported for the resource you are requesting.
HTTP Status 400
Error Code P-400-4
Reason This resource is already subscribed for the requested delivery method
This error occurs when you send a subscription request for a delivery method to which you have already subscribed.
HTTP Status 403
Error Code P-403-1
Reason Subscription is disabled on your Project
This error occurs when push delivery services have been disabled for your account for some reasons. To resolve this, please get in touch with our support team.
HTTP Status 403
Error Code P-403-2
Reason Requested Resource Subscription not Authorized
This error occurs when you are trying to subscribe to a data resource for which push delivery services are not yet supported.