} else if (e instanceof Error) {
throw (Error) e;
} else if (e instanceof RuntimeException) {
throw (RuntimeException) e;
}
throw new ChannelException(e);
} finally {
interrupted = interrupted || Thread.currentThread().isInterrupted();
try {
transaction.close();
} catch (Throwable e) {
if (committed) {
if (e instanceof Error) {
throw (Error) e;
} else if (e instanceof RuntimeException) {
throw (RuntimeException) e;
} else {
throw new ChannelException(e);
}
} else {
logger.error(
"Failed to close transaction after error, exception follows:", e);
}