Commit 6e9e9f7d authored by Luna Riegel's avatar Luna Riegel
Browse files

Refactor: Rework error logging

parent bc94ffc4
......@@ -265,6 +265,7 @@ public class EmbeddedDatabaseHandler {
Array array = con.createArrayOf("VARCHAR(255)", idStrings);
ps.setArray(1, array);
ResultSet rs = ps.executeQuery();
boolean encounteredError = false;
Map<GmlId, CityObject> objects= new HashMap<>();
while (rs.next()) {
try (InputStream is = rs.getBinaryStream("data")) {
......@@ -278,11 +279,13 @@ public class EmbeddedDatabaseHandler {
});
objects.put(co.getGmlId(),co);
} catch (InvalidClassException | ClassCastException | SerializationException e){
//TODO: change this log to reflect ids map
String msg = String.format("Deserialization of CityObject \"%s\" failed",ids);
logger.error(msg,e);
//Cant get the id of the failed Feature, as the deserialization didn't work.
encounteredError = true;
}
}
if (encounteredError){
logger.error("Deserialization of one or more Features failed");
}
return objects;
} catch (IOException e) {
throw new EmbeddedDatabaseHandlerException(e);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment