diff options
-rw-r--r-- | theme-compiler/src/com/vaadin/sass/ScssStylesheet.java | 2 | ||||
-rw-r--r-- | theme-compiler/src/com/vaadin/sass/handler/SCSSErrorHandler.java | 33 |
2 files changed, 35 insertions, 0 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java b/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java index e2ffe060bc..ccbb22a2c3 100644 --- a/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java +++ b/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java @@ -27,6 +27,7 @@ import org.w3c.css.sac.InputSource; import com.vaadin.sass.handler.SCSSDocumentHandler; import com.vaadin.sass.handler.SCSSDocumentHandlerImpl; +import com.vaadin.sass.handler.SCSSErrorHandler; import com.vaadin.sass.parser.Parser; import com.vaadin.sass.resolver.ScssStylesheetResolver; import com.vaadin.sass.resolver.VaadinResolver; @@ -81,6 +82,7 @@ public class ScssStylesheet extends Node { } Parser parser = new Parser(); + parser.setErrorHandler(new SCSSErrorHandler()); parser.setDocumentHandler(handler); parser.parseStyleSheet(source); diff --git a/theme-compiler/src/com/vaadin/sass/handler/SCSSErrorHandler.java b/theme-compiler/src/com/vaadin/sass/handler/SCSSErrorHandler.java new file mode 100644 index 0000000000..9aac12d707 --- /dev/null +++ b/theme-compiler/src/com/vaadin/sass/handler/SCSSErrorHandler.java @@ -0,0 +1,33 @@ +package com.vaadin.sass.handler; + +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.ErrorHandler; + +public class SCSSErrorHandler implements ErrorHandler { + + @Override + public void error(CSSParseException arg0) throws CSSException { + System.out.println("Error when parsing file \n" + arg0.getURI() + + " on line " + arg0.getLineNumber() + ", column " + + arg0.getColumnNumber()); + System.out.println(arg0.getMessage() + "\n"); + } + + @Override + public void fatalError(CSSParseException arg0) throws CSSException { + System.out.println("FATAL Error when parsing file \n" + arg0.getURI() + + " on line " + arg0.getLineNumber() + ", column " + + arg0.getColumnNumber()); + System.out.println(arg0.getMessage() + "\n"); + } + + @Override + public void warning(CSSParseException arg0) throws CSSException { + System.out.println("Warning when parsing file \n" + arg0.getURI() + + " on line " + arg0.getLineNumber() + ", column " + + arg0.getColumnNumber()); + System.out.println(arg0.getMessage() + "\n"); + } + +} |