Closed apfelbox closed 5 years ago
This changes the behavior of request()
request()
{ response: Response, success: boolean, // true if status code is 2xx, false if 400 data: /* payload */, }
{ error: Error, reason: "request_failed", }
{ response: Response, error: Error, reason: "invalid_json", }
{ response: Response, data: any, reason: "status", }
This changes the behavior of
request()
Success Case (Promise is resolved)
IF
Return Type
Failure Case: Request (Promise is rejected)
IF
Return Type
Failure Case: JSON (Promise is rejected)
IF
Return Type
Failure Case: Status Code (Promise is rejected)
IF
Return Type