File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 4141import org .phoebus .olog .es .api .model .OlogLog ;
4242import org .phoebus .ui .javafx .ImageCache ;
4343
44+ import java .util .logging .Level ;
45+ import java .util .logging .Logger ;
46+
4447
4548public class LogEntryDisplayController {
4649
50+ static Logger log = Logger .getLogger (LogEntryDisplayController .class .getName ());
51+
4752 @ FXML
4853 @ SuppressWarnings ("unused" )
4954 private SingleLogEntryDisplayController singleLogEntryDisplayController ;
@@ -160,8 +165,13 @@ public void jumpToLogEntry() {
160165 return ;
161166 }
162167
163- if (logEntryTableViewController .goBackAndGoForwardActions .isPresent ()) {
164- logEntryTableViewController .goBackAndGoForwardActions .get ().loadLogEntryWithID (logEntryIDToJumpTo );
168+ if (logEntryIDToJumpTo > 0 ) {
169+ if (logEntryTableViewController .goBackAndGoForwardActions .isPresent ()) {
170+ boolean success = logEntryTableViewController .goBackAndGoForwardActions .get ().loadLogEntryWithID (logEntryIDToJumpTo );
171+ if (!success ) {
172+ log .log (Level .WARNING , "Error loading entry with log entry ID: " + logEntryIDToJumpTo + "." );
173+ }
174+ }
165175 }
166176 }
167177
Original file line number Diff line number Diff line change @@ -172,12 +172,18 @@ private void addGoForwardAction() {
172172 }
173173 }
174174
175- protected void loadLogEntryWithID (Long id ) {
175+ protected boolean loadLogEntryWithID (Long id ) {
176176 goForwardActions .clear ();
177177 addGoBackAction ();
178178
179- LogEntry logEntry = controller .client .getLog (id );
180- gotoLogEntry (logEntry );
179+ try {
180+ LogEntry logEntry = controller .client .getLog (id );
181+ gotoLogEntry (logEntry );
182+ return true ;
183+ }
184+ catch (RuntimeException runtimeException ) {
185+ return false ;
186+ }
181187 }
182188
183189 protected void goBack () {
You can’t perform that action at this time.
0 commit comments