All Products
Search
Document Center

API Gateway:How to obtain the error message

Last Updated:Dec 01, 2017

If the API request reaches the gateway, the gateway returns the request result message.

Check the request header in the returned result. Results starting with X-Ca are all returned from the gateway. The important message contained in the result includes:

  1. X-Ca-Request-Id: 7AD052CB-EE8B-4DFD-BBAF-EFB340E0A5AF
  2. //The unique ID of the request. Once the request reaches the API gateway, the API gateway generates a request ID and returns it to the client through the response header. We recommend that you record the request ID in both the client and backend services for troubleshooting and tracing.
  3. X-Ca-Error-Message: Invalid Url
  4. //An error message returned from the API Gateway. When a request fails, the API Gateway returns the error message to the client through the response header.
  5. X-Ca-Debug-Info: {"ServiceLatency":0,"TotalLatency":2}
  6. //A debug message returned when the debug mode is enabled. The message can be changed later and is used only for reference at the debugging stage.

The header in X-Ca-Error-Message essentially clarifies the error cause. The X-Ca-Request-Id can be provided to technical support engineers for log searching.