@Test public void testGetMessageShowsBaseExceptionMessage() { Exception exception = new Exception("SomeExceptionMessage"); LoaderException loaderException = new LoaderException(exception, null, ""); String message = loaderException.getMessage(); assertThat(message, is("Error reading source: Base error message: " + exception.toString())); }
@Override public String getMessage() { if (sourceDescription != null) { return "Error reading source: " + sourceDescription + " Base error message: " + super.getMessage(); } else { return super.getMessage(); } }
LoaderException extends Exception { @Override public String getMessage() { if (sourceDescription != null) { return "Error reading source: " + sourceDescription + " Base error message: " + super.getMessage(); } else { return super.getMessage(); } } }
LoaderException extends Exception { @Override public String getMessage() { if (sourceDescription != null) { return "Error reading source: " + sourceDescription + " Base error message: " + super.getMessage(); } else { return super.getMessage(); } } LoaderException(Exception base, Loader loader, String sourceDescription); }
LoaderException extends Exception { @Override public String getMessage() { if (sourceDescription != null) { return "Error reading source: " + sourceDescription + " Base error message: " + super.getMessage(); } else { return super.getMessage(); } } LoaderException(Exception base, Loader loader, String sourceDescription); @Override synchronized Exception getCause(); @Override String getMessage(); }
LoaderException extends Exception { @Override public String getMessage() { if (sourceDescription != null) { return "Error reading source: " + sourceDescription + " Base error message: " + super.getMessage(); } else { return super.getMessage(); } } LoaderException(Exception base, Loader loader, String sourceDescription); @Override synchronized Exception getCause(); @Override String getMessage();  }