X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftypes%2Fexceptions%2FSCLTypeParseException.java;fp=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftypes%2Fexceptions%2FSCLTypeParseException.java;h=c178e0a849fc84fcc27a06c3c43edbedc10975d7;hp=0000000000000000000000000000000000000000;hb=969bd23cab98a79ca9101af33334000879fb60c5;hpb=866dba5cd5a3929bbeae85991796acb212338a08 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/exceptions/SCLTypeParseException.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/exceptions/SCLTypeParseException.java new file mode 100644 index 000000000..c178e0a84 --- /dev/null +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/exceptions/SCLTypeParseException.java @@ -0,0 +1,33 @@ +package org.simantics.scl.compiler.types.exceptions; + +import java.util.Collection; +import java.util.Collections; + +public class SCLTypeParseException extends Exception { + + private static final long serialVersionUID = -8245068555543510452L; + + Collection problems; + + public SCLTypeParseException(Collection problems) { + super(toString(problems)); + this.problems = problems; + } + + public SCLTypeParseException(Problem problem) { + this(Collections.singleton(problem)); + } + + public Collection getProblems() { + return problems; + } + + private static String toString(Collection problems) { + StringBuilder b = new StringBuilder(); + for(Problem problem : problems) { + problem.toString(b); + b.append('\n'); + } + return b.toString(); + } +}