Tabnine Logo
Exception.getMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessage
method
in
java.lang.Exception

Best Java code snippets using java.lang.Exception.getMessage (Showing top 20 results out of 139,185)

origin: spring-projects/spring-framework

  @Override
  public String handleException(Exception exception) {
    return exception.getMessage();
  }
}
origin: spring-projects/spring-framework

  @Override
  public String handleException(Exception exception) {
    return exception.getMessage();
  }
}
origin: spring-projects/spring-framework

  @Override
  public String handleException(Exception exception) {
    return exception.getMessage();
  }
}
origin: spring-projects/spring-framework

@Override
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException {
  if (this.jmsTemplate == null) {
    throw new IllegalArgumentException("'connectionFactory' or 'jmsTemplate' is required");
  }
  try {
    initGateway();
  }
  catch (Exception ex) {
    throw new BeanInitializationException("Initialization of JMS gateway failed: " + ex.getMessage(), ex);
  }
}
origin: spring-projects/spring-framework

  @Override
  @ExceptionHandler(Exception.class)
  @ResponseBody
  public String handleException(Exception exception) {
    return exception.getMessage();
  }
}
origin: spring-projects/spring-framework

@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public String errorHandler(Exception e) {
  return e.getMessage();
}
origin: spring-projects/spring-framework

  @ExceptionHandler
  public ModelAndView handle(Exception ex) throws IOException {
    return new ModelAndView("errorView", "detail", ex.getMessage());
  }
}
origin: spring-projects/spring-framework

  @ExceptionHandler(Exception.class)
  @ResponseBody
  public String handleException(Exception exception) {
    return exception.getMessage();
  }
}
origin: spring-projects/spring-framework

private Object readResolved(Type resolvedType, HttpInputMessage inputMessage)
    throws IOException, HttpMessageNotReadableException {
  Reader reader = getReader(inputMessage);
  try {
    return readInternal(resolvedType, reader);
  }
  catch (Exception ex) {
    throw new HttpMessageNotReadableException("Could not read JSON: " + ex.getMessage(), ex, inputMessage);
  }
}
origin: spring-projects/spring-framework

public void testCheckedThrowableSync(CacheableService<?> service) throws Exception {
  String arg = UUID.randomUUID().toString();
  try {
    service.throwCheckedSync(arg);
    fail("Excepted exception");
  }
  catch (Exception ex) {
    ex.printStackTrace();
    assertEquals("Wrong exception type", IOException.class, ex.getClass());
    assertEquals(arg, ex.getMessage());
  }
}
origin: spring-projects/spring-framework

public void testCheckedThrowable(CacheableService<?> service) throws Exception {
  String arg = UUID.randomUUID().toString();
  try {
    service.throwChecked(arg);
    fail("Excepted exception");
  }
  catch (Exception ex) {
    assertEquals("Wrong exception type", IOException.class, ex.getClass());
    assertEquals(arg, ex.getMessage());
  }
}
origin: ReactiveX/RxJava

@Test
public void onCompleteFailure() {
  AtomicReference<Throwable> onError = new AtomicReference<Throwable>();
  try {
    OBSERVER_ONCOMPLETED_FAIL(onError).onComplete();
    fail("expects exception to be thrown");
  } catch (Exception e) {
    assertNull(onError.get());
    assertTrue(e instanceof SafeObserverTestException);
    assertEquals("onCompleteFail", e.getMessage());
  }
}
origin: ReactiveX/RxJava

@Test
public void onNextFailure() {
  AtomicReference<Throwable> onError = new AtomicReference<Throwable>();
  try {
    OBSERVER_ONNEXT_FAIL(onError).onNext("one");
    fail("expects exception to be thrown");
  } catch (Exception e) {
    assertNull(onError.get());
    assertTrue(e instanceof SafeSubscriberTestException);
    assertEquals("onNextFail", e.getMessage());
  }
}
origin: ReactiveX/RxJava

@Test
public void onCompleteFailure() {
  AtomicReference<Throwable> onError = new AtomicReference<Throwable>();
  try {
    OBSERVER_ONCOMPLETED_FAIL(onError).onComplete();
    fail("expects exception to be thrown");
  } catch (Exception e) {
    assertNull(onError.get());
    assertTrue(e instanceof SafeSubscriberTestException);
    assertEquals("onCompleteFail", e.getMessage());
  }
}
origin: ReactiveX/RxJava

@Test
public void onNextFailure() {
  AtomicReference<Throwable> onError = new AtomicReference<Throwable>();
  try {
    OBSERVER_ONNEXT_FAIL(onError).onNext("one");
    fail("expects exception to be thrown");
  } catch (Exception e) {
    assertNull(onError.get());
    assertTrue(e instanceof SafeObserverTestException);
    assertEquals("onNextFail", e.getMessage());
  }
}
origin: ReactiveX/RxJava

@Test
public void onNextOnErrorFailure() {
  try {
    OBSERVER_ONNEXT_ONERROR_FAIL().onNext("one");
    fail("expects exception to be thrown");
  } catch (Exception e) {
    e.printStackTrace();
    assertTrue(e instanceof SafeObserverTestException);
    assertEquals("onNextFail", e.getMessage());
  }
}
origin: ReactiveX/RxJava

@Test
public void onNextOnErrorFailure() {
  try {
    OBSERVER_ONNEXT_ONERROR_FAIL().onNext("one");
    fail("expects exception to be thrown");
  } catch (Exception e) {
    e.printStackTrace();
    assertTrue(e instanceof SafeSubscriberTestException);
    assertEquals("onNextFail", e.getMessage());
  }
}
origin: spring-projects/spring-framework

private void checkNumber(String expression, Object value, Class<?> type) {
  try {
    SpelExpressionParser parser = new SpelExpressionParser();
    SpelExpression expr = parser.parseRaw(expression);
    Object exprVal = expr.getValue();
    assertEquals(value, exprVal);
    assertEquals(type, exprVal.getClass());
  }
  catch (Exception ex) {
    fail(ex.getMessage());
  }
}
origin: ReactiveX/RxJava

@Test
public void onErrorFailure() {
  try {
    subscriberOnErrorFail().onError(new SafeSubscriberTestException("error!"));
    fail("expects exception to be thrown");
  } catch (Exception e) {
    assertTrue(e instanceof SafeSubscriberTestException);
    assertEquals("onErrorFail", e.getMessage());
  }
}
origin: ReactiveX/RxJava

@Test
public void onErrorFailure() {
  try {
    OBSERVER_ONERROR_FAIL().onError(new SafeObserverTestException("error!"));
    fail("expects exception to be thrown");
  } catch (Exception e) {
    assertTrue(e instanceof SafeObserverTestException);
    assertEquals("onErrorFail", e.getMessage());
  }
}
java.langExceptiongetMessage

Popular methods of Exception

  • printStackTrace
  • <init>
    Constructs a new exception with the specified cause and a detail message of (cause==null ? null : c
  • toString
  • getCause
  • getLocalizedMessage
  • getStackTrace
  • addSuppressed
  • initCause
  • fillInStackTrace
  • setStackTrace
  • getSuppressed
  • logWithStack
  • getSuppressed,
  • logWithStack

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now