mbeckerle commented on a change in pull request #326: Daffodil 2280 cleanup - 
removes backpointers and factory patterns no longer needed
URL: https://github.com/apache/incubator-daffodil/pull/326#discussion_r393904852
 
 

 ##########
 File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
 ##########
 @@ -175,7 +177,23 @@ class DataProcessor(
 
   def save(output: DFDL.Output): Unit = {
     val oos = new ObjectOutputStream(new 
GZIPOutputStream(Channels.newOutputStream(output)))
-    oos.writeObject(new SerializableDataProcessor(ssrd, tunablesObj))
+    val sdp = new SerializableDataProcessor(ssrd, tunablesObj)
+    try {
+      //
+      // The serialization system encapsulates exceptions or any throw really
+      // inside an IOException.
+      //
+      // We catch and undo this, and throw the original exception,
+      // which won't give us a breakpoint at the right place, but at least
+      // it will give us the right exception, and if it is an SDE, a backtrace.
+      //
 
 Review comment:
   The serialization system can still end up evaluating things and if those 
things aren't encapsulated inside an LV, their exceptions will end up here.  
LVs are needed to assign blame to the right DSOM object so that the diagnostic 
message is about a failure on a particular schema component with file/line 
information. But if the thing being serialized wasn't computed by way of an LV, 
and an exception is thrown. that's how we end up here. Preserialization calls 
are happening as we walk down the objects serializing them. As those 
preserializations cause diagnostics, we want those to be accumulated as 
SDEs/SDWs, not end up throwing here. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to