Skip to content

Commit

Permalink
Show nice notification when adding entry without connected server
Browse files Browse the repository at this point in the history
Close #806
  • Loading branch information
NWuensche committed Aug 20, 2019
1 parent 7544f19 commit ec8e35b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ protected ActionResult processException(Exception e, String scope) {
}
// IOExceptions in most cases mean temporary error,
// in some cases may mean that the action was completed anyway.
} else if(e instanceof IllegalArgumentException && !getSettings().isConfigurationOk()) {
result.setErrorType(ActionResult.ErrorType.INCORRECT_CONFIGURATION);
result.setMessage(e.toString());
} else { // other exceptions meant to be handled outside
result.setErrorType(ActionResult.ErrorType.UNKNOWN);
result.setMessage(e.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private Pair<ActionResult, Long> syncOfflineQueue(ActionRequest actionRequest) {
default:
throw new IllegalArgumentException("Unknown action: " + action);
}
} catch(IncorrectConfigurationException | UnsuccessfulResponseException | IOException e) {
} catch(IncorrectConfigurationException | UnsuccessfulResponseException | IOException | IllegalArgumentException e) {
ActionResult r = processException(e, "syncOfflineQueue()");
if(!r.isSuccess()) itemResult = r;
} catch(Exception e) {
Expand Down

0 comments on commit ec8e35b

Please sign in to comment.