Maven plugin, SCSS compilation, and Errors


I’m having the Maven plugin do the theme compilation, and it’s working fine. But to my surprise, error in compilation didn’t stop the build. Now, that’s a real bummer. I’m running the plugin with default configurations. Is there something I’m missing, or is anyone else experiencing this?

I purposefully included a nonexisting mixin, which resulted in the following log:

[ERROR] SEVERE: null [ERROR] com.vaadin.sass.internal.parser.ParseException: Mixin Definition: myMixin not found ... [INFO] Theme "VAADIN\themes\myTheme" compiled But a
severe error
wasn’t enough to halt the build. Well, to be exact, the com.vaadin.integration.maven.CompileThemeMojo didn’t get wind of the failure. This had me digging a bit more: This is in com.vaadin.sass.internal.tree.MixinNode

@Override public Collection<Node> traverse(ScssContext context) { try { replaceVariables(context); expandVariableArguments(); // for the content block, use the scope where it is defined // (consistent with sass-lang) replaceVariablesForChildren(context); // inner scope is managed by MixinNodeHandler return MixinNodeHandler.traverse(context, this); } [u] [b] catch (Exception e) [/b] [/u] { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e); [u] [b] // TODO is ignoring this exception appropriate? [/b] [/u] return Collections.emptyList(); } } Emphasize mine, naturally. EDIT: Underlines aren’t visble in the final post… Underlined: catch & TODO

EDIT: Posted too early, here’s the rest of the suff

I would argue that ignoring the exception is not appropriate, for reasons mentioned earlies. I would also argue that catching Exception is rarely a good idea. Is it here? I’m not
familiar with Vaadin’s Sass compiler to say for sure.