Skip to content

Instantly share code, notes, and snippets.

@houdq
Created May 17, 2017 03:35
Show Gist options
  • Save houdq/5a895c984b1286c06fe894f318eb5d39 to your computer and use it in GitHub Desktop.
Save houdq/5a895c984b1286c06fe894f318eb5d39 to your computer and use it in GitHub Desktop.
筛选异常
import com.sun.org.apache.xml.internal.utils.StopParseException
import java.lang.reflect.UndeclaredThrowableException
class ThirdException extends Exception {
public ThirdException(String msg) {
super(msg)
}
}
try {
a == 1
if (1)
throw new ThirdException("dd")
}
catch (Exception ex) {
if (ex.class == ThirdException) {
println(ex)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment