olabusayoT 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_r394513241
 
 

 ##########
 File path: daffodil-lib/src/main/scala/org/apache/daffodil/api/Diagnostic.scala
 ##########
 @@ -21,29 +21,64 @@ import org.apache.daffodil.util.Misc
 import org.apache.daffodil.exceptions.Assert
 import org.apache.daffodil.util.Maybe
 import org.apache.daffodil.exceptions.SchemaFileLocation
-import org.apache.daffodil.exceptions.ThinThrowableWithCause
+import org.apache.daffodil.exceptions.ThinException
 
 /**
- * Base class for all error, warning, info, and other sorts of objects
- * that capture diagnostic information.
+ * Base class for all "thin" (no stack trace) diagnostic objects.
+ * Such as processing errors.
+ */
+abstract class ThinDiagnostic(
+  schemaContext: Maybe[SchemaFileLocation],
+  dataContext: Maybe[DataLocation],
+  maybeCause: Maybe[Throwable],
+  maybeFormatString: Maybe[String],
+  args: Any*)
+  extends Diagnostic(
+    false, // thin, i.e., not isThick
+    schemaContext,
+    dataContext,
+    maybeCause,
+    maybeFormatString,
+    args: _*) {
+  Assert.invariant(maybeCause.isDefined || maybeFormatString.isDefined)
+}
+/**
+ * Base class for all thick or thin error, warning, info, and other sorts of 
objects
+ * that capture diagnostic information. Such as Schema Definition 
Errors/Warnings.
  *
  * Allows for lazy message creation, internationalization, etc.
  */
-abstract class Diagnostic(
+abstract class Diagnostic protected (
 
 Review comment:
   "protected abstract class..."

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