Limit response data in error messages to 100 characters

This commit is contained in:
Samuel Elliott 2022-12-18 12:58:13 +00:00
parent 1e75674e08
commit 7afc241190
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6

View File

@ -45,6 +45,7 @@ export class ErrorResponse<T = unknown> extends Error {
' from ' + response.url + ' (' + response.status + ' ' + response.statusText + ')\n' +
' ' + util.inspect(this.data ? this.data : this.body, {
compact: true,
maxStringLength: 100,
}).replace(/\n/g, '\n ') +
(lines.length ? '\n' + lines.join('\n') : ''),
});