1
/* Copyright 2016 Software Freedom Conservancy Inc.
3
* This software is licensed under the GNU Lesser General Public License
4
* (version 2.1 or later). See the COPYING file in this distribution.
7
namespace Geary.ImapEngine {
10
* Determines if retrying an operation might succeed or not.
12
* A recoverable failure is defined as one that may not occur
13
* again if the operation that caused it is retried, without
14
* needing to make some change in the mean time. For example,
15
* recoverable failures may occur due to transient network
16
* connectivity issues or server rate limiting. On the other hand,
17
* an unrecoverable failure is due to some problem that will not
18
* succeed if tried again unless some action is taken, such as
19
* authentication failures, protocol parsing errors, and so on.
21
private static bool is_recoverable_failure(GLib.Error err) {
23
err is EngineError.SERVER_UNAVAILABLE ||
24
err is IOError.BROKEN_PIPE ||
25
err is IOError.BUSY ||
26
err is IOError.CONNECTION_CLOSED ||
27
err is IOError.NOT_CONNECTED ||
28
err is IOError.TIMED_OUT ||
29
err is ImapError.NOT_CONNECTED ||
30
err is ImapError.TIMED_OUT ||
31
err is ImapError.UNAVAILABLE
36
* Determines if an error was caused by the remote host or not.
38
private static bool is_remote_error(GLib.Error err) {
40
err is EngineError.NOT_FOUND ||
41
err is EngineError.SERVER_UNAVAILABLE ||
42
err is IOError.CONNECTION_CLOSED ||
43
err is IOError.CONNECTION_REFUSED ||
44
err is IOError.HOST_UNREACHABLE ||
45
err is IOError.MESSAGE_TOO_LARGE ||
46
err is IOError.NETWORK_UNREACHABLE ||
47
err is IOError.NOT_CONNECTED ||
48
err is IOError.PROXY_AUTH_FAILED ||
49
err is IOError.PROXY_FAILED ||
50
err is IOError.PROXY_NEED_AUTH ||
51
err is IOError.PROXY_NOT_ALLOWED ||