提交 fb7999e1 authored 作者: Thomas Mueller's avatar Thomas Mueller

Common exception (error code 23*) are no longer written to the .trace.db file by default.

上级 c58cb3eb
...@@ -150,6 +150,16 @@ public class Trace { ...@@ -150,6 +150,16 @@ public class Trace {
traceWriter.write(TraceSystem.INFO, module, s, null); traceWriter.write(TraceSystem.INFO, module, s, null);
} }
/**
* Write a message with trace level INFO to the trace system.
*
* @param s the message
* @param t the exception
*/
public void info(String s, Throwable t) {
traceWriter.write(TraceSystem.INFO, module, s, t);
}
/** /**
* Write Java source code with trace level DEBUG to the trace system. * Write Java source code with trace level DEBUG to the trace system.
* *
......
...@@ -390,7 +390,13 @@ public class TraceObject { ...@@ -390,7 +390,13 @@ public class TraceObject {
TraceSystem.traceThrowable(e); TraceSystem.traceThrowable(e);
} else { } else {
if (e instanceof SQLException) { if (e instanceof SQLException) {
trace.error("SQLException", e); SQLException e2 = (SQLException) e;
int errorCode = e2.getErrorCode();
if (errorCode >= 23000 && errorCode < 24000) {
trace.info("SQLException", e);
} else {
trace.error("SQLException", e);
}
return (SQLException) e; return (SQLException) e;
} }
trace.error("Uncaught Exception", e); trace.error("Uncaught Exception", e);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论