tslog icon indicating copy to clipboard operation
tslog copied to clipboard

Bug: getErrorTrace(error) is undefined on custom errors

Open kinton opened this issue 11 months ago • 0 comments

Describe the bug TypeError undefined is not an object (evaluating 'getErrorTrace(error).map') on custom errors

To Reproduce Steps to reproduce the behavior:

console.log(err, String(err), String(typeof err)); logger.error( Error in custom middleware: ${middleware}:, err );

Output: (The console.log) ConnectionRefused: Unable to connect. Is the computer able to access the url? path: "http://localhost:3000/user" ConnectionRefused: Unable to connect. Is the computer able to access the url? object

(The Bug) TypeError undefined is not an object (evaluating 'getErrorTrace(error).map'), 58, 45, 58, 45, node_modules/tslog/dist/esm/runtime/nodejs/index.js error stack: • index.js prettyFormatErrorObj node_modules/tslog/dist/esm/runtime/nodejs/index.js:87 • index.js node_modules/tslog/dist/esm/runtime/nodejs/index.js:82 • ...

Expected behavior Ignore the error or print without pretty mode.

Bun Version 1.1.12

OS incl. Version macOS 15.2

kinton avatar Jan 28 '25 22:01 kinton