Skip to content

Commit

Permalink
Capture CANCELLED WebView state
Browse files Browse the repository at this point in the history
Closes #1183
  • Loading branch information
tresf committed Oct 2, 2023
1 parent 119de93 commit 35e29e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/qz/printer/action/html/WebApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ public class WebApp extends Application {
private static ChangeListener<Worker.State> stateListener = (ov, oldState, newState) -> {
log.trace("New state: {} > {}", oldState, newState);

// Cancelled should throw exception listener, but does not
// See https://github.com/qzind/tray/issues/1183
if (newState == Worker.State.CANCELLED) {
unlatch(new IOException("Page load was cancelled for an unknown reason"));
}
if (newState == Worker.State.SUCCEEDED) {
boolean hasBody = (boolean)webView.getEngine().executeScript("document.body != null");
if (!hasBody) {
Expand Down

0 comments on commit 35e29e7

Please sign in to comment.