Example usage for java.lang Throwable getMessage

List of usage examples for java.lang Throwable getMessage

Introduction

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

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:com.glweb.infrastructure.persistence.GLWebPersistenceException.java

/**
 * Constructs an instance of <code>GLWebPersistenceException</code> 
 * with a nested <code>Throwable</code>.
 * //w ww  .  j a v a 2 s. c om
 * @param throwable the Throwable to nest.
 */
public GLWebPersistenceException(Throwable throwable) {
    super(throwable.getMessage(), throwable);
}

From source file:fr.aliasource.webmail.invitation.GoingEventAction.java

@Override
public void execute(IProxy p, IParameterSource req, IResponder responder) {
    try {/*from w w w .jav  a  2s . c  o m*/
        IEventService eventService = new EventService(p.getAccount());

        String extId = req.getParameter("extId");
        String going = req.getParameter("going");

        Event event;

        event = eventService.getEventFromExtId(extId);
        eventService.updateParticipationState(event, going);
    } catch (Throwable e) {
        logger.error(e.getMessage(), e);
        responder.sendError(e.getMessage());
    }

}

From source file:uk.ac.ebi.eva.pipeline.listeners.SkippedItemListener.java

@Override
public void onSkipInRead(Throwable t) {
    logger.error("Skipped line during READ step: " + t.getMessage());
}

From source file:com.arsdigita.util.parameter.ParameterError.java

public ParameterError(final Parameter param, final Throwable throwable) {
    this(param, throwable.getMessage());

    m_throwable = throwable;//from   w w w  .  j ava 2s  . c o m
}

From source file:cd.go.contrib.elasticagents.dockerswarm.elasticagent.model.reports.StatusReportGenerationError.java

private String getOrDefaultMessage(Throwable throwable) {
    if (StringUtils.isNotBlank(throwable.getMessage())) {
        return throwable.getMessage();
    }//  w w  w. j  a  va2s.com

    return DEFAULT_ERROR_MESSAGE;
}

From source file:com.jxva.exception.ExceptionUtil.java

/**
 * Gets a short message summarising the exception.
 * <p>//from   www. j a  va2s  . co  m
 * The message returned is of the form
 * {ClassNameWithoutPackage}: {ThrowableMessage}
 *
 * @param th  the throwable to get a message for, null returns empty string
 * @return the message, non-null
 * @since Commons Lang 2.2
 */
public static String getMessage(Throwable th) {
    if (th == null) {
        return "";
    }
    String clsName = th.getClass().getName();
    String msg = th.getMessage();
    return clsName + ": " + (msg == null ? "" : msg);
}

From source file:org.intelligentsia.utility.jpa.AppTest.java

@Test
public void testBlogService() {
    Assert.assertNotNull(blogService);//ww w  .  ja  v  a 2 s  .c o  m

    try {
        blogService.createBlog("My First Site ");
    } catch (final Throwable t) {
        Assert.fail(t.getMessage());
    }
    int count = 0;
    for (@SuppressWarnings("unused")
    final Site site : blogService.findAllSite()) {
        count++;
    }
    if (count == 0) {
        Assert.fail("no site found");
    }
}

From source file:com.allogy.json.jackson.joda.ISOPeriodDeserializer.java

@Override
public Period deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
        throws IOException, JsonProcessingException {
    String textValue = jsonParser.getText();
    try {/*from   w  w w  . j  a  va2 s .c o m*/
        return new Period(textValue);
    } catch (Throwable throwable) {
        throw new InvalidFormatException(throwable.getMessage(), textValue, String.class);
    }
}

From source file:ch.fork.AdHocRailway.ui.ExceptionProcessor.java

public void processException(String msg, final Throwable e) {

    LOGGER.error(e.getMessage(), e);

    if (e instanceof SRCPException) {
        msg = "SRCP: " + msg;
    }/*from   w  w w  . jav a 2  s.c om*/
    if (StringUtils.isBlank(msg)) {
        msg = e.getMessage();
    }
    errorPanel.setErrorTextIcon(msg, e.getMessage(), ImageTools.createImageIconFromIconSet("dialog-error.png"));

}

From source file:net.sourceforge.subsonic.filter.RESTFilter.java

private String getErrorMessage(Throwable x) {
    if (x.getMessage() != null) {
        return x.getMessage();
    }//www  .  jav  a 2s.c om
    return x.getClass().getSimpleName();
}