Package ro.isdc.wro

Examples of ro.isdc.wro.WroRuntimeException


    try {
      final Properties properties = new Properties();
      properties.load(new FileInputStream(configProperties));
      return properties;
    } catch (final IOException e) {
      throw new WroRuntimeException("Exception while loading properties file from "
          + configProperties.getAbsolutePath(), e);
    }
  }
View Full Code Here


            e.getErrors().size() + " errors found while processing resource: " + resource.getUri() + " Errors are: "
                + e.getErrors());
        // collect found errors
        addReport(ResourceLintReport.create(resource.getUri(), e.getErrors()));
        if (!isFailNever()) {
          throw new WroRuntimeException("Errors found when validating resource: " + resource);
        }
      };
    }.setOptionsAsString(getOptions());
    return processor;
  }
View Full Code Here

        getProgressIndicator().addFoundErrors(e.getErrors().size());
        getLog().error(errorMessage);
        // collect found errors
        addReport(ResourceLintReport.create(resource.getUri(), e.getErrors()));
        if (!isFailNever()) {
          throw new WroRuntimeException("Errors found when validating resource: " + resource);
        }
      };
    }.setOptionsAsString(getOptions());
    return processor;
  }
View Full Code Here

  /**
   * Check whether the build should fail.
   */
  private void checkFailStatus() {
    if (!failFast && isStatusFailed()) {
      throw new WroRuntimeException("Build status: failed.");
    }
  }
View Full Code Here

    return !failNever && foundErrors > 0 && (foundErrors >= failThreshold);
  }

  private void validateReportFormat() {
    if (FormatterType.getByFormat(getReportFormat()) == null) {
      throw new WroRuntimeException("Usupported report format: " + getReportFormat() + ". Valid formats are: "
          + FormatterType.getSupportedFormatsAsCSV());
    }
  }
View Full Code Here

   */
  private SmartWroModelFactory createTestSmartModelFactory() {
    final WroModelFactory failingModelFactory = new WroModelFactory() {
      @Override
      public WroModel create() {
        throw new WroRuntimeException("Cannot create model", new IOException("invalid model stream"));
      }

      @Override
      public void destroy() {
      }
View Full Code Here

    try {
      return getContext().evaluateString(scope, script, sourceName, 1, null);
    } catch (final RhinoException e) {
      final String message = RhinoUtils.createExceptionMessage(e);
      LOG.error("JavaScriptException occured: {}", message);
      throw new WroRuntimeException(message);
    } finally {
      // Rhino throws an exception when trying to exit twice. Make sure we don't get any exception
      if (Context.getCurrentContext() != null) {
        Context.exit();
      }
View Full Code Here

      }
      LOG.debug("Skipping {} from {}. No match found: {}", new Object[] {
          uri, getDecoratedObject(), toString() });
      WroUtil.safeCopy(reader, writer);
    } else {
      throw new WroRuntimeException("Wrong usage of "
          + toString() + ". Please use it as a pre-processor.");
    }
  }
View Full Code Here

    try {
      stopWatch.start("createModel");
      final Type type = new TypeToken<WroModel>() {}.getType();
      final InputStream is = getModelResourceAsStream();
      if (is == null) {
        throw new WroRuntimeException("Invalid model stream provided!");
      }
      final WroModel model = new Gson().fromJson(new InputStreamReader(getModelResourceAsStream()), type);
      LOG.debug("json model: {}", model);
      if (model == null) {
        throw new WroRuntimeException("Invalid content provided, cannot build model!");
      }
      return model;
    } catch (final Exception e) {
      throw new WroRuntimeException("Invalid model found!", e);
    } finally {
      stopWatch.stop();
      LOG.debug(stopWatch.prettyPrint());
    }
  }
View Full Code Here

    try {
      return RhinoScriptBuilder.newClientSideAwareChain().addJSON().evaluateChain(
        getScriptAsStream(), DEFAULT_JS);
    } catch (final Exception e) {
      LOG.error("Processing error:" + e.getMessage(), e);
      throw new WroRuntimeException("Processing error", e);
    }
  }
View Full Code Here

TOP

Related Classes of ro.isdc.wro.WroRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.