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.

try/catch (in some cases) causes resolveCallIds to fail

See original GitHub issue


  • run express#20 (“should throw when Content-Type is an array”)
    • you see several errors coming from RuntimeDataProvider.resolveCallIds
      • NOTE: this tries to look up the callId (traceId) of any CallExpression that was recorded while running; based on staticTrace data
    • the issue seems to come from the fact that an error is thrown inside the try block in lib\router\layer.js:95
  • express#18 shows similar symptoms.

NOTE: For some reason samples/error1.js does not suffer from that problem.

  • -> Maybe it only happens from nested function calls inside the try block? Not sure…

Steps to take

  • Talk to @MiccWan (he is already researching this problem)
  • First, find out if the instrumentation data is complete: i.e. every call-related trace must have a callId and the call result trace must have a resultCallId.
    • -> Maybe add a Verbose mode that monitors the call stack resolution algorithm (similar to how Verbose mode in traceVisitors monitors the AST exploration)
  • There seems to be a bug where ThrowArgument has two result traces (but only one BCE). This might or might not be related (but also needs fixing).
    • At least this is what happens in Express#8.
    • Need to isolate and fix this in instrumentation.
    • NOTE: Traced in #346

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

MiccWancommented, Feb 24, 2021

#346 mentioned that ThrowArgument is traced more than once.

Domiiicommented, May 7, 2021

Express#20 has long been fixed, and, while still dirty, resolveCallIds has been revised and its internal error reporting largely improved several times since. Also, @MiccWan has done a great job, fixing up mentioned RDP and PDP issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tryCatch in R execute in case of error - Stack Overflow
Is it possible to execute certain commands in case of error when using tryCatch in R ? I am using the code below...
Read more >
Error handling, "try...catch" - The Modern JavaScript Tutorial
Usually, a script “dies” (immediately stops) in case of an error, ... So, try...catch can only handle errors that occur in valid code....
Read more >
Error handling in R with tryCatchLog: Catching, logging, post ...
The main advantages of the tryCatchLog function over tryCatch are: Easy logging of errors, warnings and messages into a file or console ...
Read more >
Exceptions and debugging - Advanced R. - Hadley Wickham
tryCatch () has one other argument: finally . It specifies a block of code (not a function) to run regardless of whether the...
Read more >
try...catch - JavaScript - MDN Web Docs - Mozilla
The try...catch statement is comprised of a try block and either a catch ... of expected errors, and then re-throw the error in...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found