Skip to content

Commit

Permalink
Report the error in the exception, fixes #183
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Dec 15, 2020
1 parent b9348fc commit 9a84c14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/fusesource/jansi/internal/Kernel32.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import java.io.IOException;

import org.fusesource.jansi.WindowsSupport;

/**
* Interface to access Win32 base APIs.
*
Expand Down Expand Up @@ -525,7 +527,7 @@ public static INPUT_RECORD[] readConsoleInputHelper(
PeekConsoleInputW(handle, inputRecordPtr, count, length)
: ReadConsoleInputW(handle, inputRecordPtr, count, length);
if (res == 0) {
throw new IOException("ReadConsoleInputW failed");
throw new IOException("ReadConsoleInputW failed: " + WindowsSupport.getLastErrorMessage());
}
if (length[0] <= 0) {
return new INPUT_RECORD[0];
Expand Down

0 comments on commit 9a84c14

Please sign in to comment.