aboutsummaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java
diff options
context:
space:
mode:
authorFelype Santiago Ferreira <felype@vaadin.com>2013-12-04 16:06:43 +0200
committerVaadin Code Review <review@vaadin.com>2013-12-10 14:13:52 +0000
commitb5a080cced33ad088ccd269da64ae495000baaa9 (patch)
tree898aab4667b4a61031ba4ed03d0175f34298be5d /theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java
parent9026cef9719e8607c289bb91515bb23b5b0b9fe5 (diff)
downloadvaadin-framework-b5a080cced33ad088ccd269da64ae495000baaa9.tar.gz
vaadin-framework-b5a080cced33ad088ccd269da64ae495000baaa9.zip
Provides error location for ArithmeticException. (#11877)
Change-Id: Ieb63ad556c3dc01196f0b9898aed9670923c9138
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();
}
}