Skip to content

Commit

Permalink
Merge pull request #717 from qbicsoftware/fix/session-logging-and-dis…
Browse files Browse the repository at this point in the history
…card-dialog

Hotfix
  • Loading branch information
KochTobi authored Jul 19, 2024
2 parents da104d6 + 26c4c19 commit 1b31a7d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package life.qbic.datamanager.exceptionhandling;

import static java.util.Objects.nonNull;
import static java.util.Objects.requireNonNull;
import static life.qbic.logging.service.LoggerFactory.logger;

Expand Down Expand Up @@ -54,15 +55,28 @@ private void displayUserFriendlyMessage(UI ui, ApplicationException exception) {
requireNonNull(ui, "ui must not be null");
requireNonNull(exception, "exception must not be null");
if (ui.isClosing()) {
log.error(
"tried to show message on closing UI ui[%s] vaadin[%s] http[%s]".formatted(ui.getUIId(),
ui.getSession().getPushId(), ui.getSession().getSession().getId()));
if (nonNull(ui.getSession())) {
log.error(
"tried to show message on closing UI ui[%s] vaadin[%s] http[%s]".formatted(ui.getUIId(),
ui.getSession().getPushId(), ui.getSession().getSession().getId()));
} else {
log.error(
"tried to show message on closing UI ui[%s] session is null".formatted(ui.getUIId()));
}

return;
}
if (!ui.isAttached()) {
log.error(
"tried to show message on detached UI ui[%s] vaadin[%s] http[%s]".formatted(ui.getUIId(),
ui.getSession().getPushId(), ui.getSession().getSession().getId()));
if (nonNull(ui.getSession())) {
log.error(
"tried to show message on detached UI ui[%s] vaadin[%s] http[%s]".formatted(
ui.getUIId(),
ui.getSession().getPushId(), ui.getSession().getSession().getId()));
} else {
log.error(
"tried to show message on detached UI ui[%s] session is null".formatted(
ui.getUIId()));
}
return;
}
UserFriendlyErrorMessage errorMessage = userMessageService.translate(exception, ui.getLocale());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public CancelConfirmationNotificationDialog() {
Button redButton = new Button("Discard");
redButton.addClassName("danger");
setConfirmButton(redButton);
Button cancelButton = new Button("Continue");
Button cancelButton = new Button("Continue Editing");
setCancelButton(cancelButton);
}

Expand Down

0 comments on commit 1b31a7d

Please sign in to comment.