Skip to content

Commit 5c14a18

Browse files
authored
Improving Error Message (#50)
* Adding more information to the error message generated at failed HTTP requests. * Use the original status code on the response object
1 parent 6c0bf53 commit 5c14a18

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/api-request.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ export class HttpRequestHandler {
104104
const parsingError = new FirebaseAppError(
105105
AppErrorCodes.UNABLE_TO_PARSE_RESPONSE,
106106
`Failed to parse response data: "${ error.toString() }". Raw server` +
107-
`response: "${ response }."`,
107+
`response: "${ response }". Status code: "${ res.statusCode }". Outgoing ` +
108+
`request: "${ options.method } ${options.host}${ options.path }"`,
108109
);
109110
reject({
110111
statusCode,

0 commit comments

Comments
 (0)