Summary
In the same way you can define
formats and templates for successful application responses to a method, you can also define error templates for each format you've added and for each type of known
error.
Set up custom error templates
Creating or editing a method shows a list of Error Sheets that you can manage in each method of your APIs.
There you can define a genetic error for any type of error, or specific errors according to error codes. You should consider that the documents shown here are the platform's internal error cards mapped with the error codes delivered by your data sources.
- METHOD DEFAULT: This is the default error that would apply to all error codes and all the output formats you've added to the method.
- 204 - DO NOT DATA FOUND: By default status 204 delivers an answer without content. If a custom template is defined, the status of the response would be changed to 500, and the content of the template you define here.
Error 204 may arise because the data source responded correctly but without content or, for example, because a filter was applied in the data view and there is no result for the values sent.
- 404 - NOT FOUND: If the data source responds to error 404 it would apply this template.
- 408 - REQUEST ACCEPTED: When a data source takes more than 20 seconds to respond, the platform responds with error code 408, representing that the request has not been available. The platform continued to try to receive the response from the data source even if the request to the API method is not retried. Once the answer was available, the request must be made to the method.
This template allows you to set up a waiting message and custom retry requests.
- 422 - TABLE NOT FOUND: This error code applies automatically when its data source is in an Excel file and the sheet/table referred to in the datasheet/table referred in the One case is that the sheet that was referenced when creating the data view has been removed from the Excel file.
- 500 - INTERNAL SERVER ERROR: This error code applies when its data source responds to error 500.
- 502 - ORIGIN RESPONSE ERROR: This error code applies when its data source responds with some error code that it was not possible to map with the rest of the report.