[ 
https://issues.apache.org/jira/browse/DAFFODIL-2841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17764783#comment-17764783
 ] 

Mike Beckerle commented on DAFFODIL-2841:
-----------------------------------------

A layer can fail to parse/unparse, or have a runtime SDE just like any other 
parsing primitive. 

runtime SDE are fatal, as are unparse errors.

regular parse errors should cause backtracking which unwinds the layer back to 
prior point of uncertainty, unbinds any variables that were bound, etc. No 
prior point of uncertainty means the parse error is fatal. 

We definitely need to make sure there is test coverage showing a layer can fail 
and backtracking works.

Consider: there is a gzip layer. What if the data is corrupt and cannot be 
gunzipped before parsing? That could be part of forward speculation down a 
choice branch. It should backtrack and try the next choice alternative. 

 

> Layers do not support  (or poorly documented) creating SDE or 
> Parse/UnparseErrors
> ---------------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2841
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2841
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>            Reporter: Steve Lawrence
>            Priority: Major
>
> From what I can tell, there is no way for a layer signal that an error 
> occurred, or at least non of our current layers seem to check and handle any 
> errors, so if it can be done it needs better examples.
> If a we do something like layerRuntimeInfo.runtimeData.SDE(...), then that 
> SDE exception is caught by the layer infrastructure and turned into a 
> LayerExecutionException, which seems like it's used to indicate bugs in a 
> layer. Throwing an SDE should not be considered a bug.
> It looks like some functions do provide ParseOrUnparseState, so maybe we 
> could create a Parse/UnparseError, but it's not exactly clear or documented 
> if/how this should be used, or even if the layer infrastructure checks the 
> state. This needs some clarification.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to