olabusayoT commented on code in PR #1058:
URL: https://github.com/apache/daffodil/pull/1058#discussion_r1281119790


##########
daffodil-lib/src/main/scala/org/apache/daffodil/lib/api/Diagnostic.scala:
##########
@@ -308,4 +308,12 @@ trait WithDiagnostics {
    * then one can proceed to run the compiled entity.
    */
   def isError: Boolean
+
+  /**
+   * Helper method to check that isError is false, if not it throws
+   * a usage error caused by illegal state caused by a compilation error
+   */
+  def checkNotError(): Unit = {
+    Assert.usage(!isError, new 
IllegalStateException(getDiagnostics.find(_.isError).get))

Review Comment:
   How's changing the definition to 
   
   ```scala
     def checkNotError(): Unit = {
       Assert.usage(!isError, new IllegalStateException(
         "Must call isError() to ensure there are no errors",
         getDiagnostics.find(_.isError).get,
       ))
     }
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to