提交 bcce0daf 编写于 作者: J jurgen

DS initialize logging fix

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