Example usage for java.lang RuntimeException getMessage

List of usage examples for java.lang RuntimeException getMessage

Introduction

In this page you can find the example usage for java.lang RuntimeException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:com.opoopress.maven.plugins.plugin.AbstractOpooPressMojo.java

@Override
public final void execute() throws MojoExecutionException, MojoFailureException {
    try {//from   w w w . j a  v  a  2s .co  m
        ConfigImpl configImpl = new ConfigImpl(baseDirectory, getOverrideConfiguration());

        if (configImpl.getConfigFiles().length == 0) {
            getLog().info("No OpooPress site to generate.");
            return;
        }

        executeInternal(configImpl);
    } catch (RuntimeException e) {
        throw new MojoFailureException(e.getMessage(), e);
    }
}

From source file:de.uzk.hki.da.grid.IrodsCopyExecutor.java

public boolean execute(CopyJob cj) {
    logger.debug("starting Syncing ... ");
    if (cj == null) {
        logger.error("CopyJob is null");
        return false;
    }// w w w .jav  a  2  s  .  co  m

    if (dirPrefix == null) {
        logger.error("dirPrefix is null");
        return false;
    }

    String targetFile = "/" + cj.getDest_name() + "/" + dirPrefix + cj.getAipGridPath();
    String targetDir = FilenameUtils.getFullPath(targetFile);
    if (!iclc.exists(targetDir)) {
        logger.info("Creating " + targetDir + " now");
        iclc.mkCollection(targetDir);
    }
    logger.debug("iRSYNC " + cj.getSource() + " & " + targetFile + " with " + cj.getParams());
    try {
        String out = iclc.rsync(cj.getSource(), targetFile, cj.getParams());
        logger.debug(out);
    } catch (RuntimeException irex) {
        logger.error(irex.getMessage());
        return false;
    }
    return true;
}

From source file:com.espertech.esper.core.thread.TimerUnitSingle.java

public void run() {
    try {/*  w w  w. j a  v a 2 s  . c om*/
        EPRuntimeImpl.processStatementScheduleSingle(handleCallback, services, exprEvaluatorContext);

        runtime.dispatch();

        runtime.processThreadWorkQueue();
    } catch (RuntimeException e) {
        log.error("Unexpected error processing timer execution: " + e.getMessage(), e);
    }
}

From source file:com.aestheticsw.jobkeywords.service.termextractor.impl.fivefilters.FiveFiltersClientTest.java

public void brokenJobTerms() throws FileNotFoundException {
    String content = FileUtils.getClassResourceAsString("../broken-content.html", this);
    try {/*  www  . j  a v a 2 s.c  o  m*/
        TermFrequencyList terms = fiveFiltersClient.getTermFrequencyList(content, Locale.US);
        fail("Expected FiveFilters to throw exception");
    } catch (RuntimeException expected) {
        assertNotNull(expected);
        assertTrue(expected.getMessage().contains("invalid content"));
        assertTrue(expected.getMessage().contains("index="));
    }
}

From source file:com.steeleforge.aem.ironsites.wcm.taglib.SetModeTag.java

@Override
public int doEndTag() throws JspException {
    try {/*from  w  w w  .j  av  a  2  s  .c o  m*/
        if (null != this.wcmmode) {
            this.wcmmode.toRequest(WCMUtil.getSlingRequest(pageContext));
        }
    } catch (RuntimeException re) {
        LOG.debug(re.getMessage());
        throw new JspException(re);
    }
    return EVAL_PAGE;
}

From source file:com.espertech.esper.core.thread.RouteUnitSingle.java

public void run() {
    try {// w w w .  ja va  2 s  .  c  o  m
        epRuntime.processStatementFilterSingle(handleCallback.getAgentInstanceHandle(), handleCallback,
                theEvent, filterVersion);

        epRuntime.dispatch();

        epRuntime.processThreadWorkQueue();
    } catch (RuntimeException e) {
        log.error("Unexpected error processing route execution: " + e.getMessage(), e);
    }
}

From source file:natalia.dymnikova.cluster.scheduler.impl.ComputePool.java

public void handle(final CheckFlow checkFlow) {
    log.trace("Handling CheckFlow: {}", lazyDebugString(checkFlow));

    try {/*  w w w . ja  v  a2s.c o  m*/
        if (!check(checkFlow.getOperator())) {
            sender().tell(State.Error.getDefaultInstance(), self());
        } else {
            sender().tell(State.Ok.getDefaultInstance(), self());
        }
    } catch (final RuntimeException e) {
        log.error(e.getMessage(), e);
        sender().tell(State.Error.getDefaultInstance(), self());
    }
}

From source file:com.vino.filters.ExceptionFilter.java

private void writeTechnicalError(RuntimeException e, RestxResponse resp) throws IOException {

    Ack ack = Ack.error(e.getMessage());

    resp.setStatus(HttpStatus.BAD_REQUEST).setContentType("application/json");

    mapper.writeValue(resp.getWriter(), ack);
}

From source file:com.MyHistory.Service.ServiceCuenta.java

public Response crearAdministrador(String pNombre, String pApellido, String pEmail, Date pFechaNacimiento,
        String pNombreUsuario, String pPassword) {
    Administrador admin = new Administrador(pNombre, pApellido, pEmail, pFechaNacimiento, null, pNombreUsuario,
            pPassword, true);/*from  w  ww  . j a  va2 s .c o m*/
    FactoryManager fabrica_manager = new FactoryManager();
    IManagerUsuario manager_cuenta = fabrica_manager.getManagerUsuario();
    try {
        Response respuesta = new Response();
        boolean agrego_admin = manager_cuenta.registrarAdministrador(admin);
        respuesta.setResultado(agrego_admin);
        if (!agrego_admin) {
            respuesta.setMensaje(IConstantMessage.MSG_REG_ADMIN_ERROR);
            return respuesta;
        }
        respuesta.setMensaje(IConstantMessage.MSG_REG_ADMIN_EXITO);
        return respuesta;
    } catch (RuntimeException ex) {
        Response respueta = new Response(false, ex.getMessage());
        return respueta;
    }
}

From source file:com.irahul.rest.CustomExceptionMapper.java

@Override
public Response toResponse(RuntimeException e) {
    logger.info("mapping exception", e);
    return Response.status(Status.CONFLICT).entity(e.getMessage()).build();
}