return compiled.getBytes(Charset.forName(this.encoding)); } catch (LessException e) { String msg = "Failed to compile less file " + e.getFilename() + " line " + e.getLine() + " cause: " + e.getMessage(); LOG.warn(msg); throw new CompileException(msg, e);
@SuppressWarnings("ThrowableResultOfMethodCallIgnored") private byte[] handleException(LessException e) { String filename = e.getFilename(); List<String> extractList = e.getExtract(); String extract = null; if (extractList != null) { extract = Joiner.on(",").join(extractList); } // Try to detect missing imports if (Strings.isNullOrEmpty(extract)) { FileNotFoundException fileNotFoundException = Exceptions.findCause(e, FileNotFoundException.class); if (fileNotFoundException != null) { extract = fileNotFoundException.getMessage(); } } throw new WicketRuntimeException("can't parse " + filename + "; error in line " + e.getLine() + " on column " + e.getColumn() + "; " + e.getType() + ": " + extract); }