void (RangeSearchTask caller, IOException e) { if (inBackground) { ApplicationManager.getApplication().invokeLater(() -> { onSearchCatchedException(caller, e); }); } else { onSearchCatchedException(caller, e); } }