JSON response error detector
Last updated
Last updated
[io/http/utils/JSON response error detector]
Wraps failed HTTP response into an error, including a message. Example A
message
set to "Response failed"
{"status": 200, "headers": {}, "body": "null"}@1 received via response
null@1 sent via data
Example B
message
set to "Response failed"
{"status": 400, "headers": {}, "body": {"success": false}}@1 received via response
{"error": "Response failed", "details": {"success": false}}@1 sent via error
Keywords: http, request, response, error, identify, detect, json
response:
Receives JSON response that might contain an error.
error msg: string
Receives error message to appear in error
.
data: any
Sends response data, when the response was successful.
error: {"error": string, optional "details": any}