@naturalcycles/js-lib 14.168.0 → 14.168.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78,7 +78,7 @@ function _stringifyAny(obj, opt = {}) {
|
|
|
78
78
|
// Error that has no `data`, but has `code` property
|
|
79
79
|
s += `\ncode: ${obj.code}`;
|
|
80
80
|
}
|
|
81
|
-
if (opt.includeErrorData && (0, error_util_1._isErrorObject)(obj)) {
|
|
81
|
+
if (opt.includeErrorData && (0, error_util_1._isErrorObject)(obj) && Object.keys(obj.data).length) {
|
|
82
82
|
s += '\n' + _stringifyAny(obj.data, opt);
|
|
83
83
|
}
|
|
84
84
|
if (opt.includeErrorStack && obj.stack) {
|
|
@@ -74,7 +74,7 @@ export function _stringifyAny(obj, opt = {}) {
|
|
|
74
74
|
// Error that has no `data`, but has `code` property
|
|
75
75
|
s += `\ncode: ${obj.code}`;
|
|
76
76
|
}
|
|
77
|
-
if (opt.includeErrorData && _isErrorObject(obj)) {
|
|
77
|
+
if (opt.includeErrorData && _isErrorObject(obj) && Object.keys(obj.data).length) {
|
|
78
78
|
s += '\n' + _stringifyAny(obj.data, opt);
|
|
79
79
|
}
|
|
80
80
|
if (opt.includeErrorStack && obj.stack) {
|
package/package.json
CHANGED
|
@@ -122,7 +122,7 @@ export function _stringifyAny(obj: any, opt: StringifyAnyOptions = {}): string {
|
|
|
122
122
|
s += `\ncode: ${(obj as any).code}`
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
if (opt.includeErrorData && _isErrorObject(obj)) {
|
|
125
|
+
if (opt.includeErrorData && _isErrorObject(obj) && Object.keys(obj.data).length) {
|
|
126
126
|
s += '\n' + _stringifyAny(obj.data, opt)
|
|
127
127
|
}
|
|
128
128
|
|