提交 bcce0daf 编写于 作者: J jurgen

DS initialize logging fix

Error logging fix.
上级 46184a09
......@@ -589,9 +589,13 @@ public class DataSourceDescriptor
if (initialize) {
monitor.subTask("Initialize data source");
dataSource.initialize(monitor);
// Change connection properties
try {
dataSource.initialize(monitor);
} catch (Throwable e) {
log.error("Error initializing datasource", e);
}
// Change connection properties
initConnectionState(monitor);
}
......
......@@ -194,7 +194,11 @@ public class Log
corePluginID,
message == null ? null : message.toString()));
} else {
log.log(GeneralUtils.makeExceptionStatus(severity, t));
if (message == null) {
log.log(GeneralUtils.makeExceptionStatus(severity, t));
} else {
log.log(GeneralUtils.makeExceptionStatus(severity, message.toString(), t));
}
}
}
}
......
......@@ -287,11 +287,16 @@ public class GeneralUtils {
}
public static IStatus makeExceptionStatus(String message, Throwable ex)
{
return makeExceptionStatus(IStatus.ERROR, message, ex);
}
public static IStatus makeExceptionStatus(int severity, String message, Throwable ex)
{
return new MultiStatus(
ModelPreferences.PLUGIN_ID,
0,
new IStatus[]{makeExceptionStatus(ex)},
new IStatus[]{makeExceptionStatus(severity, ex)},
message,
null);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册