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.

Bring back stack traces in pretty formatter

See original GitHub issue

As of version 0.8.0 the pretty formatter no longer prints stack traces under failing steps - you have to wait until the end to see why a step failed.

In an ideal world where all scenarios are blazing fast this isn’t a problem, but unfortunately I’m not in the ideal world. This means I have to wait a long time before I can start investigating a failure.

Can we have a variant of the pretty formatter (pretty-verbose maybe) that spits out errors as they happen?

/cc @tooky @jbpros @mattwynne

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
floriboncommented, Sep 6, 2016

I’ve found a workaround that works perfectly for me: use the StepResult hook and get the error from stepResult.getFailureException:

this.StepResult(function(stepResult) {
  if (stepResult.getStatus() === 'failed') {
    var exception = stepResult.getFailureException();
    console.error(exception.stack);
  }
});

Or do fancier things such as adding colors and indentation:

var stacks = exception.split('\n');
stacks[0] = '\x1b[31m' + stacks[0];
stacks[stacks.length-1] = stacks[stacks.length-1] + '\x1b[0m';
stacks.forEach(function(line) {
  console.error('    ' + line);
});

That’s not as clean as a built-in option but on the other hand this gives more flexibility to the user.

0reactions
lock[bot]commented, Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stack Trace Formatter - Pretty print your exception messages
Using the .NET stack trace formatter, you can pretty print any stack trace and either copy and paste it or download a screenshot...
Read more >
How can I get the current stack trace in Java?
You can use Thread.currentThread().getStackTrace() . That returns an array of StackTraceElement s that represent the current stack trace of a program.
Read more >
traceback — Print or retrieve a stack traceback — Python 3.11 ...
This module provides a standard interface to extract, format and print stack traces of Python programs. It exactly mimics the behavior of the...
Read more >
Format your .Net exceptions to see the StackTrace.
When querying the logs in Visual Studio or in Sql Management Studio's table view, I would get a result-set that would not let...
Read more >
Analyze external stack traces | IntelliJ IDEA Documentation
In the Analyze Stack Trace dialog that opens, paste the external stack trace or thread dump into the Put a stack trace or...
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