Skip to content

Commit

Permalink
Fixing case for DescriberIoException - 2nd try
Browse files Browse the repository at this point in the history
  • Loading branch information
mmichaelis committed Mar 29, 2015
1 parent 017cb1e commit cc56e6d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
Expand Up @@ -29,7 +29,7 @@
* <p>
* Utility for silently appending to any appendable. As some appendables might throw
* IOExceptions they are caught and wrapped into a dedicated
* {@link DescriberTempException}.
* {@link DescriberIoException}.
* </p>
*
* @since 1.0.0
Expand Down Expand Up @@ -60,7 +60,7 @@ public static void silentAppend(@NotNull Appendable appendable, @Nullable Object
}
}
} catch (IOException e) {
throw new DescriberTempException(
throw new DescriberIoException(
format("Unable to append values {0} to appendable {1}.", values, appendable), e);
}
}
Expand Down
Expand Up @@ -52,7 +52,7 @@ private Describe() {
* @param appendable appendable to add value's string representation to
* @param value the value to describe
* @throws NullPointerException if appendable is {@code null}
* @throws DescriberTempException if a failure occurs accessing the appendable
* @throws DescriberIoException if a failure occurs accessing the appendable
* @since 1.0.0
*/
@Contract("null, _ -> fail")
Expand All @@ -74,7 +74,7 @@ public static void describeTo(@NotNull Appendable appendable, @Nullable Object v
* representation for large objects; maxCount typically refers to list or array
* elements
* @throws NullPointerException if appendable is {@code null}
* @throws DescriberTempException if a failure occurs accessing the appendable
* @throws DescriberIoException if a failure occurs accessing the appendable
* @since 1.0.0
*/
@Contract("null, _, _ -> fail")
Expand All @@ -97,7 +97,7 @@ public static void describeTo(@NotNull Appendable appendable, @Nullable Object v
* negative value denotes <em>unlimited</em> - it is recommended to use {@link
* DescriberProperties#UNLIMITED}
* @throws NullPointerException if appendable is {@code null}
* @throws DescriberTempException if a failure occurs accessing the appendable
* @throws DescriberIoException if a failure occurs accessing the appendable
* @since 1.0.0
*/
public static void describeTo(@NotNull Appendable appendable, @Nullable Object value,
Expand Down Expand Up @@ -186,7 +186,7 @@ public static String describe(@Nullable Object value, int maxCount) {
* detect self-contained object hierarchies
* @throws NullPointerException if appendable and/or recursiveMeAndOtherConsumer is
* {@code null}
* @throws DescriberTempException if a failure occurs accessing the appendable
* @throws DescriberIoException if a failure occurs accessing the appendable
* @since 1.0.0
*/
@Contract("null, _, _, _ -> fail; _, _, _, null -> fail")
Expand Down
Expand Up @@ -98,7 +98,7 @@ default Object validatedValue(@Nullable Object value) {
* @param appendable appendable to add value's string representation to
* @param value the value to describe
* @throws NullPointerException if appendable is {@code null}
* @throws DescriberTempException if a failure occurs accessing the appendable
* @throws DescriberIoException if a failure occurs accessing the appendable
* @throws DescriberNotApplicableException if the value handed over to the Describer cannot
* be handled by this describer; you should have called
* {@link #test(Object)} before
Expand Down Expand Up @@ -129,7 +129,7 @@ default void describeTo(@NotNull Appendable appendable, @Nullable Object value)
* representation for large objects; maxCount typically refers to list or array
* elements
* @throws NullPointerException if appendable is {@code null}
* @throws DescriberTempException if a failure occurs accessing the appendable
* @throws DescriberIoException if a failure occurs accessing the appendable
* @throws DescriberNotApplicableException if the value handed over to the Describer cannot
* be handled by this describer; you should have called
* {@link #test(Object)} before
Expand Down
Expand Up @@ -23,11 +23,11 @@
*
* @since 1.0.0
*/
public class DescriberTempException extends DescriberException {
public class DescriberIoException extends DescriberException {

private static final long serialVersionUID = -2610615491164970753L;

public DescriberTempException(String message, Throwable cause) {
public DescriberIoException(String message, Throwable cause) {
super(message, cause);
}

Expand Down
Expand Up @@ -67,7 +67,7 @@ default void describeTo(@NotNull Appendable appendable, @Nullable Object value,
* negative value denotes <em>unlimited</em> - it is recommended to use {@link
* DescriberProperties#UNLIMITED}
* @throws NullPointerException if appendable is {@code null}
* @throws DescriberTempException if a failure occurs accessing the appendable
* @throws DescriberIoException if a failure occurs accessing the appendable
* @throws DescriberNotApplicableException if the value handed over to the Describer cannot
* be handled by this describer; you should have called
* {@link #test(Object)} before
Expand Down Expand Up @@ -98,7 +98,7 @@ default void describeTo(@NotNull Appendable appendable, @Nullable Object value,
* detect self-contained object hierarchies
* @throws NullPointerException if appendable and/or recursiveMeAndOtherConsumer is
* {@code null}
* @throws DescriberTempException if a failure occurs accessing the appendable
* @throws DescriberIoException if a failure occurs accessing the appendable
* @throws DescriberNotApplicableException if the value handed over to the Describer cannot
* be handled by this describer; you should have called
* {@link #test(Object)} before
Expand Down
Expand Up @@ -69,7 +69,7 @@ public void wrapIOException() throws Exception {
IOException exceptionToThrow = new IOException(testName.getMethodName());
Appendable appendable = new FailingAppendable(exceptionToThrow);

expectedException.expect(DescriberTempException.class);
expectedException.expect(DescriberIoException.class);
expectedException.expectCause(sameInstance(exceptionToThrow));
expectedException.expectMessage(not(isEmptyOrNullString()));

Expand Down
Expand Up @@ -93,7 +93,7 @@ public void describeTo(@NotNull Appendable appendable,
try {
appendable.append(describer.apply(value));
} catch (IOException e) {
throw new DescriberTempException("Failure.", e);
throw new DescriberIoException("Failure.", e);
}
}

Expand Down
Expand Up @@ -105,7 +105,7 @@ public void describeTo(@NotNull Appendable appendable, @Nullable Object value,
}
appendable.append(describer.apply(value));
} catch (IOException e) {
throw new DescriberTempException("Failure.", e);
throw new DescriberIoException("Failure.", e);
}
}

Expand Down

0 comments on commit cc56e6d

Please sign in to comment.