Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throwable and Error should not be caught #724

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected XContentBuilder toXContent(XContentBuilder builder, Params params, Map
} else {
try {
builder.value(o);
} catch (Throwable e) {
} catch (Exception e) {
throw new IOException("unknown object class for value:" + o.getClass().getName() + " " + o);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void fetch() throws Exception {
logger.debug("fetch");
try {
getSource().fetch();
} catch (Throwable e) {
} catch (Exception e) {
setThrowable(e);
logger.error(e.getMessage(), e);
}
Expand All @@ -198,13 +198,13 @@ public void afterFetch() throws Exception {
writeState();
try {
getSource().afterFetch();
} catch (Throwable e) {
} catch (Exception e) {
setThrowable(e);
logger.error(e.getMessage(), e);
}
try {
getSink().afterFetch();
} catch (Throwable e) {
} catch (Exception e) {
setThrowable(e);
logger.error(e.getMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ public StandardSource<C> register(CallableStatement statement, Map<String, Objec
logger.debug("registerOutParameter: n={} type={}", n, toJDBCType(type));
try {
statement.registerOutParameter(n, toJDBCType(type));
} catch (Throwable t) {
} catch (Exception e) {
logger.warn("can't register out parameter " + n + " of type " + type);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/xbib/pipeline/AbstractPipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public R call() throws Exception {
close();
} catch (InterruptedException e) {
logger.warn("interrupted");
} catch (Throwable t) {
} catch (Exception t) {
logger.error(t.getMessage(), t);
throw t;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/xbib/tools/Importer.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ public void run(boolean bootstrap) {
} else {
execute();
}
} catch (Throwable e) {
} catch (Exception e) {
logger.error(e.getMessage(), e);
} finally {
try {
cleanup();
if (executor != null) {
executor.shutdown();
}
} catch (Throwable e) {
} catch (Exception e) {
logger.warn(e.getMessage(), e);
}
}
Expand All @@ -165,15 +165,15 @@ public void run() {
try {
prepare();
execute();
} catch (Throwable e) {
} catch (Exception e) {
logger.error(e.getMessage(), e);
} finally {
try {
cleanup();
if (executor != null) {
executor.shutdown();
}
} catch (Throwable e) {
} catch (Exception e) {
logger.warn(e.getMessage(), e);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/xbib/tools/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void main(String[] args) {
InputStream in = args.length > 1 ? new FileInputStream(args[1]) : System.in;
commandLineInterpreter.reader("args", in).run(true);
in.close();
} catch (Throwable e) {
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
Expand Down