This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jaxx. See http://git.nuiton.org/jaxx.git commit e45ddd0dc24e78f0c92e3673e7a402a4de4526da Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Aug 24 14:32:01 2014 +0200 fixes #3457: Improve error message when css are not well formed --- .../src/main/java/jaxx/compiler/JAXXCompiler.java | 14 +++++++++++--- .../src/main/java/jaxx/compiler/tags/StyleHandler.java | 15 ++++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java b/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java index e848a18..9e8c241 100644 --- a/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java +++ b/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java @@ -1003,7 +1003,7 @@ public class JAXXCompiler { if (warnAutoCssImport) { - reportWarning("The css file "+styleFile+" can be automaticly imported since it is named as his jaxx file."); + reportWarning("The css file " + styleFile + " can be automaticly imported since it is named as his jaxx file."); } @@ -1013,8 +1013,16 @@ public class JAXXCompiler { String content = loadFile(styleFile); getSourceFiles().push(styleFile); try { - Stylesheet stylesheet = StylesheetHelper.processStylesheet(content); - registerStylesheet(stylesheet); + Stylesheet style = StylesheetHelper.processStylesheet(content); + registerStylesheet(style); + } catch (CompilerException e) { + String message= "Css file content is not valid :" + styleFile; + if (e instanceof jaxx.compiler.css.parser.ParseException) { + jaxx.compiler.css.parser.ParseException parseException = (jaxx.compiler.css.parser.ParseException) e; + + message += " (line: " + parseException.getLine() + " - col:" + parseException.getColumn() + ") "; + } + reportError(message, e); } finally { // whatever could be result, must pop this source file diff --git a/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java b/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java index c96ce5c..6dfe719 100644 --- a/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java +++ b/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java @@ -88,9 +88,18 @@ public class StyleHandler implements TagHandler { if (source) { compiler.reportError("<style> tag has both a source attribute and an inline stylesheet"); } - Stylesheet stylesheet = - StylesheetHelper.processStylesheet(style.toString()); - compiler.registerStylesheet(stylesheet); + try { + Stylesheet stylesheet = StylesheetHelper.processStylesheet(style.toString()); + compiler.registerStylesheet(stylesheet); + } catch (CompilerException e) { + String message = "Inline Css content is not valid"; + if (e instanceof jaxx.compiler.css.parser.ParseException) { + jaxx.compiler.css.parser.ParseException parseException = (jaxx.compiler.css.parser.ParseException) e; + + message += " (line: " + parseException.getLine() + " - col:" + parseException.getColumn() + ") "; + } + compiler.reportError(message, e); + } } } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.