question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DX: Cleaner stack traces

See original GitHub issue

This is an idea for cleaner stack traces pointing directly to where errors exist.

https://github.com/sindresorhus/clean-stack

console.log(error.stack);
/* Before
Error: Missing unicorn
    at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
*/
console.log(cleanStack(error.stack));
/* After
Error: Missing unicorn
    at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)
*/

I’m playing around with this idea right now.

I would love to hear feedback from the community.

Any potential downsides to this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidWellscommented, May 10, 2017

Yeah maybe it should work like:

With SLS_DEBUG off (aka default)

  • showing shorter clean stack traces for every error
  • mapping common errors with human friendly messages/links to helpful docs (error tracking should help in this regard)

With SLS_DEBUG on

0reactions
medikoocommented, Oct 16, 2020

Closing as it was probably addressed in best possible way with https://github.com/serverless/serverless/pull/6502

Now we show stack traces only for programmer errors (so unexpected crashes that in all cases signal a bug) or when user has set SLS_DEBUG. In all other cases we show only error message which is expected to be meaningful enough (if it’s not it’s an error reporting bug)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stack Trace Cleaning • NServiceBus Samples • Particular Docs
The Stack Trace Cleaner ... The cleaner uses some simple string manipulation to remove much of the noise from the exception information. It...
Read more >
org.mockito.exceptions.stacktrace.StackTraceCleaner.isIn ...
Finds the source file of the target stack trace. * Returns the default value if source file cannot be found.
Read more >
Passing an async function as a callback causes the error stack ...
Missing stack trace has nothing to do with Promises. Write the same code that has functions calling each other in synchronous way and...
Read more >
Cleaner stacktraces. | Codementor
Make your stack-traces terser, and hide sensitive information.
Read more >
Navigating Stacktraces :: CIDER Docs
The stacktrace buffers provide such an option when displaying an internal error. A toggle button will be displayed with the error type's name,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found