Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

At the API, an object that can have diagnostics like this exhibits the Daffodil API trait WithDiagnostics, which describes an API that includes two important attributes: 'isError' and 'getDiagnostics'. (These OOLAG-specific implementation classes aren't visible at the level of the API to Daffodil. Only Diagnostic, and WithDiagnostic are visible at the Daffodil API for users of Daffodil. The implementation trait for implementations of WithDiagnostics is called DiagnosticsProviding.)

The key functionality of OOLAGValue is to wrap all its calculations in a try/catch, so that if any part of the calculation throws an exception, that is captured, turned into a diagnostic object, and becomes part of the "answer".

...