Skip to content

Commit 783eaa5

Browse files
Fix: faulted StorageInputStream hides error cause (Azure#28638)
The method checkStreamState() for faulty stream hides the error cause as only the error message is given to the new RuntimeException.
1 parent ff7cc06 commit 783eaa5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/StorageInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public synchronized int available() {
160160
*/
161161
private synchronized void checkStreamState() {
162162
if (this.streamFaulted) {
163-
throw LOGGER.logExceptionAsError(new RuntimeException(this.lastError.getMessage()));
163+
throw LOGGER.logExceptionAsError(new RuntimeException(this.lastError.getMessage(), this.lastError));
164164
}
165165
}
166166

0 commit comments

Comments
 (0)