10 lines
246 B
JavaScript
10 lines
246 B
JavaScript
function wrapStack(err, internalErr) {
|
|
const extraLine = (err.stack?.split(/\n/g) || [])[1];
|
|
const [firstLine, ...rest] = internalErr.stack?.split(/\n/g) || [];
|
|
return [firstLine, extraLine, ...rest].join("\n");
|
|
}
|
|
;
|
|
export {
|
|
wrapStack
|
|
};
|