Skip to content

Commit d6da6b2

Browse files
committed
Better exception message
1 parent 99e4429 commit d6da6b2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/org/apache/commons/io/build/AbstractOrigin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,8 @@ public CharSequence getCharSequence(final Charset charset) throws IOException {
449449
* @throws UnsupportedOperationException if this method is not implemented in a concrete subclass.
450450
*/
451451
public File getFile() {
452-
throw new UnsupportedOperationException(String.format("%s#getFile() for origin %s", getClass().getSimpleName(), origin));
452+
throw new UnsupportedOperationException(
453+
String.format("%s#getFile() for %s origin %s", getClass().getSimpleName(), origin.getClass().getSimpleName(), origin));
453454
}
454455

455456
/**
@@ -483,7 +484,8 @@ public OutputStream getOutputStream(final OpenOption... options) throws IOExcept
483484
* @throws UnsupportedOperationException if this method is not implemented in a concrete subclass.
484485
*/
485486
public Path getPath() {
486-
throw new UnsupportedOperationException(String.format("%s#getPath() for origin %s", getClass().getSimpleName(), origin));
487+
throw new UnsupportedOperationException(
488+
String.format("%s#getPath() for %s origin %s", getClass().getSimpleName(), origin.getClass().getSimpleName(), origin));
487489
}
488490

489491
/**

0 commit comments

Comments
 (0)