aboutsummaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java
diff options
context:
space:
mode:
Diffstat (limited to 'theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java')
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java b/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java
index 13b6f0e936..f9ab90fc32 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java
+++ b/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java
@@ -15,12 +15,28 @@
*/
package com.vaadin.sass.internal.expression.exception;
+import com.vaadin.sass.internal.parser.LexicalUnitImpl;
+
public class ArithmeticException extends RuntimeException {
public ArithmeticException(String errorMsg) {
super(errorMsg);
}
- public ArithmeticException() {
- super("Illegal arithmetic expression");
+ public ArithmeticException(String error, LexicalUnitImpl term) {
+ super(buildMessage(error, term));
+ }
+
+ private static String buildMessage(String message, LexicalUnitImpl term) {
+ StringBuilder builder = new StringBuilder(message);
+
+ builder.append(": \"");
+ builder.append(term.toString());
+ builder.append("\" [");
+ builder.append(term.getLineNumber());
+ builder.append(",");
+ builder.append(term.getColumnNumber());
+ builder.append("]");
+
+ return builder.toString();
}
}