]> gerrit.simantics Code Review - simantics/platform.git/blob
f5b2632d13b397b627251f2fe17a3475a16d7461
[simantics/platform.git] /
1 package org.simantics.scl.compiler.top;
2
3 import org.simantics.scl.compiler.errors.CompilationError;
4
5 public class SCLExpressionCompilationException extends Exception {
6
7     private static final long serialVersionUID = 970640318254433797L;
8
9     private final CompilationError[] errors;
10     
11     public SCLExpressionCompilationException(CompilationError[] errors) {
12         super(createMessage(errors));
13         this.errors = errors;
14     }
15     
16     private static String createMessage(CompilationError[] errors) {
17         StringBuilder b = new StringBuilder();
18         for(CompilationError error : errors)
19             b.append(error.description).append('\n');
20         return b.toString();
21     }
22
23     public CompilationError[] getErrors() {
24         return errors;
25     }
26
27 }