Skip to content

Commit

Permalink
Prevent NPE during cleanup and improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mrotteveel committed Nov 23, 2023
1 parent 0238e9e commit feb65bd
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,19 @@ void sharedAfter() {
try {
fbManager.dropDatabase(databasePath, FBTestProperties.DB_USER, FBTestProperties.DB_PASSWORD);
} catch (Exception e) {
e.printStackTrace();
System.getLogger(getClass().getName()).log(System.Logger.Level.ERROR, "Exception dropping DB", e);
}
}
} catch (Exception ex){
ex.printStackTrace();
} catch (Exception e){
System.getLogger(getClass().getName()).log(System.Logger.Level.ERROR, "Exception dropping DBs", e);
} finally {
try {
if (!(fbManager == null || fbManager.getState().equals("Stopped"))) {
fbManager.stop();
}
} catch (Exception ex) {
ex.printStackTrace();
} catch (Exception e) {
System.getLogger(getClass().getName())
.log(System.Logger.Level.ERROR, "Exception stopping FBManager", e);
}
fbManager = null;
}
Expand Down

0 comments on commit feb65bd

Please sign in to comment.