mirror of https://github.com/rusefi/dfu_java.git
better error message
This commit is contained in:
parent
cf1ab4ac03
commit
bb3bed3890
|
@ -10,8 +10,9 @@ public class DfuConnectionUtil {
|
|||
while (state.getState() == DfuCommandGetStatus.State.DFU_DOWNLOAD_BUSY || state.getState() == DfuCommandGetStatus.State.DFU_ERROR) {
|
||||
state = DfuCommandGetStatus.read(logger, device);
|
||||
logger.info("Loop state " + state);
|
||||
if (System.currentTimeMillis() - enter > 10 * DfuConnection.SECOND)
|
||||
throw new IllegalStateException("State does not look good");
|
||||
long durationMs = System.currentTimeMillis() - enter;
|
||||
if (durationMs > 10 * DfuConnection.SECOND)
|
||||
throw new IllegalStateException("State does not look good after " + durationMs + "ms, still " + state);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue