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.

Exception catch problem

See original GitHub issue

Hi, our team use kilim based on kilim1.0. Here, we has a problem about Exception-catch . The problem we can reprodue by code:

package kilim.examples;

import kilim.Mailbox;
import kilim.Pausable;
import kilim.Task;

public class IllegalArException extends Task {
	public static void main(String[] args) {
		new IllegalArException().start();
	}

	public void execute() throws Pausable {
		int i = 2;
		try {
			new Mailbox<String>().get(1000);// RPC
			throw new DolphinRunException();
		} catch (DolphinRunException ex) {
			System.out.println("DolphinRunException:" + i);
		} catch (Exception ex) {
			System.out.println("Exception:" + i);
		}
	}

}

class DolphinRunException extends RuntimeException {
	
}

expect result:

DolphinRunException:2

but we get the result:

Exception:2

Thanks first.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
walkerzhaocommented, Jan 27, 2018

Thanks, We will try kilim 2.0 in our services. I have moved the commit to our team inner kilim version, it works fine now.

1reaction
nqzerocommented, Jan 26, 2018

i released org.db4j:kilim:2.0.0-15 to maven central with the fix above. i included a java 7 version using the jdk7 classifier, fixed a bug in the java 7 build, and added some docs on using kilim 2.0 with java 7. i have not yet decided if i’m going to automate the jdk7-classifier releases

https://github.com/nqzero/kilim/tree/f96867ed67797b670f87503a1ff5cc1a658cd287

kilim 2.0 should be compatible with most 1.0 code (the public api for kilim has always been poorly defined, so it’s possible that you’ve used portions of kilim that we didn’t consider public). if you’re having trouble migrating to kilim 2.0, i’m happy to work with you to figure out why and add missing functionality back into 2.0 or document the correct workaround. if you’re interested, create an issue. kilim 2.0 is still pre-release so it’s easy to make changes at this point. it will be harder once an official 2.0 release is made

i’m closing this issue. if you still see problems with exception handling, please reopen it

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle an exception using try-catch - Microsoft Learn
The purpose of a try-catch block is to catch and handle an exception generated by working code. Some exceptions can be handled in...
Read more >
What is Exception Handling? - SearchSoftwareQuality
A catch statement is a group of statements that handle the specific thrown exception.
Read more >
Error handling, "try...catch" - The Modern JavaScript Tutorial
The “try…catch” syntax · First, the code in try {...} is executed. · If there were no errors, then catch (err) is ignored:...
Read more >
Java Exceptions (Try...Catch) - W3Schools
The catch statement allows you to define a block of code to be executed, if an error occurs in the try block. The...
Read more >
Exception-handling Problems
Ex- ceptions are thrown objects that you might want to catch and handle, if you know what to do with them. Examples are...
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