Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: getErrorTrace(error) is undefined on custom errors #313

Open
kinton opened this issue Jan 28, 2025 · 0 comments
Open

Bug: getErrorTrace(error) is undefined on custom errors #313

kinton opened this issue Jan 28, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@kinton
Copy link

kinton commented Jan 28, 2025

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 kinton added the bug Something isn't working label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant