Skip to content
Snippets Groups Projects
Commit 395ea4f1 authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

Better analyze of why an attribute is not archived in getErrorMessageForAttribute

parent d5969006
No related branches found
No related merge requests found
......@@ -246,6 +246,15 @@ public final class HdbCollectorFactory {
return result;
}
public void registerError(AttributeLightMode attributeLightMode, Exception exception) {
if ((attributeLightMode != null) && (exception != null)) {
collectorErrorTable.put(
new AttrSuperMode(attributeLightMode.getAttribute_complete_name(), attributeLightMode
.getDataFormat(), attributeLightMode.getDataType(), attributeLightMode.getWritable(),
attributeLightMode.getMode()), exception.getMessage());
}
}
/**
* This method returns the instance of Hdb_Collector associated / associable
* to an attribute. In this method, attributes are not grouped by mode.
......
......@@ -1086,6 +1086,7 @@ public class HdbArchiver extends DeviceImpl implements TangoConst {
logger.error("start failed", e);
koAttributes.add(attCompleteName.toLowerCase());
okAttributes.remove(attCompleteName.toLowerCase());
collectorFactory.registerError(attributeLightMode, e);
logger.error("KO: " + attCompleteName);
} catch (final Exception e) {
try {
......@@ -1095,6 +1096,7 @@ public class HdbArchiver extends DeviceImpl implements TangoConst {
koAttributes.add(attCompleteName.toLowerCase());
okAttributes.remove(attCompleteName.toLowerCase());
e.printStackTrace();
collectorFactory.registerError(attributeLightMode, e);
logger.error("KO " + attCompleteName + " unexpected " + e);
}
}
......
......@@ -242,6 +242,15 @@ public class TdbCollectorFactory {
return result;
}
public void registerError(AttributeLightMode attributeLightMode, Exception exception) {
if ((attributeLightMode != null) && (exception != null)) {
collectorErrorTable.put(
new AttrSuperMode(attributeLightMode.getAttribute_complete_name(), attributeLightMode
.getDataFormat(), attributeLightMode.getDataType(), attributeLightMode.getWritable(),
attributeLightMode.getMode()), exception.getMessage());
}
}
/**
* This method returns the instance of TdbCollector associated / associable
* to an attribute. In this method, attributes are grouped by mode.
......
......@@ -1073,6 +1073,7 @@ public class TdbArchiver extends DeviceImpl implements TangoConst {
logger.error("start failed ", e);
koAttributes.add(attCompleteName.toLowerCase());
okAttributes.remove(attCompleteName.toLowerCase());
collectorFactory.registerError(attributeLightMode, e);
logger.error("KO: " + attCompleteName);
} catch (final Exception e) {
try {
......@@ -1082,6 +1083,7 @@ public class TdbArchiver extends DeviceImpl implements TangoConst {
e.printStackTrace();
koAttributes.add(attCompleteName.toLowerCase());
okAttributes.remove(attCompleteName.toLowerCase());
collectorFactory.registerError(attributeLightMode, e);
logger.error("KO " + attCompleteName + " unexpected " + e);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment