Skip to content

Commit 96cad26

Browse files
committed
fix: pretty print json in errors, resolves #4953
1 parent f6f78af commit 96cad26

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/adapter/src/rest.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,8 @@ class RESTAdapter extends Adapter.extend(BuildURLMixin) {
12831283

12841284
if (payloadContentType === 'text/html' && typeof payload === 'string' && payload.length > 250) {
12851285
shortenedPayload = '[Omitted Lengthy HTML]';
1286+
} else if (typeof payload === 'object' && payload !== null) {
1287+
shortenedPayload = JSON.stringify(payload, null, 2);
12861288
} else {
12871289
shortenedPayload = payload;
12881290
}

0 commit comments

Comments
 (0)