mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-28 01:31:05 -06:00
either log or throw, but not both
This commit is contained in:
parent
0230686a23
commit
1fe38b4394
@ -46,7 +46,7 @@ public class UnsettableValuesBinder implements ValuesArrayBinder<PreparedStateme
|
||||
return boundStmt;
|
||||
} catch (Exception e) {
|
||||
String typNam = (objects[i]==null ? "NULL" : objects[i].getClass().getCanonicalName());
|
||||
logger.error("Error binding column " + preparedStatement.getVariables().asList().get(i).getName() + " with class " + typNam + ": " + e.getMessage(), e);
|
||||
logger.error("Error binding column " + preparedStatement.getVariables().asList().get(i).getName() + " with class " + typNam, e);
|
||||
throw e;
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// sb.append("Error binding objects to prepared statement directly, falling back to diagnostic binding layer:");
|
||||
|
@ -154,8 +154,7 @@ public class CQLSessionCache implements Shutdownable {
|
||||
builder = clusterEval.eval();
|
||||
logger.info("successfully applied:" + clusteropts.get());
|
||||
} catch (Exception e) {
|
||||
logger.error("Unable to evaluate: " + clusteropts.get() + " in script context:" + e.getMessage());
|
||||
throw e;
|
||||
throw new RuntimeException("Unable to evaluate: " + clusteropts.get() + " in script context:",e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,6 @@ public class YamlCQLStatementLoader {
|
||||
data = xform.apply(data);
|
||||
} catch (Exception e) {
|
||||
RuntimeException t = new ActivityInitializationError("Error applying string transform to input", e);
|
||||
logger.error(t.getMessage(), t);
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class Save implements RowCycleOperator {
|
||||
List<ColumnDefinitions.Definition> definitions = row.getColumnDefinitions().asList();
|
||||
logger.error("Unable to save '" + Arrays.toString(varnames) + "' from " +
|
||||
definitions.stream().map(ColumnDefinitions.Definition::getName)
|
||||
.collect(Collectors.joining(",","[","]")) + ": " + e.getMessage(),e);
|
||||
.collect(Collectors.joining(",","[","]")) + ": ",e);
|
||||
throw e;
|
||||
}
|
||||
return 0;
|
||||
|
@ -58,7 +58,7 @@ public class UnsettableValuesBinder implements ValuesArrayBinder<PreparedStateme
|
||||
List<ColumnDefinition> cdefs = new ArrayList<>();
|
||||
preparedStatement.getVariableDefinitions().forEach(cdefs::add);
|
||||
|
||||
logger.error("Error binding column " + cdefs.get(i).getName() + " with class " + typNam + ": " + e.getMessage(), e);
|
||||
logger.error("Error binding column " + cdefs.get(i).getName() + " with class " + typNam, e);
|
||||
throw e;
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// sb.append("Error binding objects to prepared statement directly, falling back to diagnostic binding layer:");
|
||||
|
@ -38,7 +38,6 @@ public class YamlCQLStatementLoader {
|
||||
data = xform.apply(data);
|
||||
} catch (Exception e) {
|
||||
RuntimeException t = new ActivityInitializationError("Error applying string transform to input", e);
|
||||
logger.error(t.getMessage(), t);
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ public class RawStmtsLoader {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
RuntimeException t = new ActivityInitializationError("Error applying string applyTransforms to input", e);
|
||||
if (logger != null) logger.error(t.getMessage(), t);
|
||||
throw t;
|
||||
}
|
||||
|
||||
@ -76,7 +75,6 @@ public class RawStmtsLoader {
|
||||
data = xform.apply(data);
|
||||
} catch (Exception e) {
|
||||
RuntimeException t = new ActivityInitializationError("Error applying string applyTransforms to input", e);
|
||||
if (logger != null) logger.error(t.getMessage(), t);
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,6 @@ public class HistoStatsCSVWriter {
|
||||
PrintStream writer = new PrintStream(logfile);
|
||||
return writer;
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class PathFinder {
|
||||
}
|
||||
return Optional.empty();
|
||||
} catch (Exception e) {
|
||||
logger.trace("Error while looking in classpath for " + e.getMessage(), e);
|
||||
logger.trace("Error while looking in classpath for " + candidatePath, e);
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ public class ValuesCheckerCoordinator implements Callable<RunData> {
|
||||
lock.lock();
|
||||
goTime.signalAll();
|
||||
} catch (Exception e) {
|
||||
logger.error("Error while signaling threads: " + e.getMessage(), e);
|
||||
logger.error("Error while signaling threads:", e);
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
|
Loading…
Reference in New Issue
Block a user