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.

Local vars not restored properly after call pausable method and throw exception

See original GitHub issue

public class Exceptions extends Task { private String fWithOutMailBox() throws Pausable { throw new RuntimeException(); // no pausable method }

private String fWithMailBox() throws Pausable {
    new Mailbox<String>().get(1000);  // has pausable method
    throw new RuntimeException();
}

public void execute() throws Pausable {
    String foo = "data";
    try {
        foo = fWithOutMailBox();
    } catch (Throwable t) {
        System.out.println("foo=" + foo);
    }
    String foo2 = "data";
    try {
        foo2 = fWithMailBox();
    } catch (Throwable t) {
        System.out.println("foo2=" + foo2);
    }
}

public static void main(String args[]) {
    new Exceptions().start();
}

} ================expect result will be foo=data foo2=data ================while real result is foo=data foo2=null

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nqzerocommented, Oct 18, 2016

i was able to reproduce and will take a look

0reactions
nqzerocommented, Jan 29, 2018

this is fixed in kilim 2.0 by a series of commits, the last of which is https://github.com/nqzero/kilim/commit/e64e6af61ba03bd7d9d90398ed125f7d4fc63359

for the related commits, search the log messages for the words: born, live and 49 (ie this issue)

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - How do you implement a re-try-catch? - Stack Overflow
I don't think we called to just log the exception. I thing the catch block is meant to give us the opportunity of...
Read more >
Exceptions and debugging - Advanced R. - Hadley Wickham
When a exiting handler from tryCatch() is called, the execution of the function is interrupted and the handler is called. withCallingHandlers() is rarely...
Read more >
Proposal: Make local variables available upon exception at ...
Summary When executing through VisualStudio, having access to local variables can be invaluable for debugging exceptions.
Read more >
Chaining tasks using continuation tasks | Microsoft Learn
InvalidOperationException exception. A continuation is itself a Task and doesn't block the thread on which it's started.
Read more >
Local variables should not be declared and then immediately ...
Local variables should not be declared and then immediately returned or thrown ... Declaring a variable only to immediately return or throw it...
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