Skip to content

Commit 4ccc6fc

Browse files
committed
Improved logging of Rest Response
1 parent 0b570ae commit 4ccc6fc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/framework/playwright/API/RESTRequest.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ export default class RESTRequest {
4949
const headers = response.headers();
5050
const statusCode = response.status();
5151
const restResponse: RESTResponse = new RESTResponse(headers, body, statusCode, description);
52-
console.log(`Response body: ${JSON.stringify(JSON.parse(body), undefined, 2)}`);
52+
try {
53+
console.log(`Response body: ${JSON.stringify(JSON.parse(body), undefined, 2)}`);
54+
} catch (error) {
55+
console.log(`Response body: ${body}`);
56+
}
5357
return restResponse;
5458
}
5559
/**

0 commit comments

Comments
 (0)