push_messaging/client/error.rs
1#[derive(Debug)]
2pub enum ClientError{
3 /// The sender account used to send a message couldn't be authenticated. Possible causes are:
4 ///
5 /// Authorization header missing or with invalid syntax in HTTP request.
6 ///
7 /// * The Firebase project that the specified server key belongs to is
8 /// incorrect.
9 /// * Legacy server keys only—the request originated from a server not
10 /// whitelisted in the Server key IPs.
11 ///
12 /// Check that the token you're sending inside the Authentication header is
13 /// the correct Server key associated with your project. See Checking the
14 /// validity of a Server key for details. If you are using a legacy server
15 /// key, you're recommended to upgrade to a new key that has no IP
16 /// restrictions.
17 Unauthorized,
18
19 /// Check that the JSON message is properly formatted and contains valid
20 /// fields (for instance, making sure the right data type is passed in).
21 InvalidMessage(String),
22
23 /// The server couldn't process the request. Retry the same request, but you must:
24 ///
25 /// * Honor the [RetryAfter](enum.RetryAfter.html) value if included.
26 /// * Implement exponential back-off in your retry mechanism. (e.g. if you
27 /// waited one second before the first retry, wait at least two second
28 /// before the next one, then 4 seconds and so on). If you're sending
29 /// multiple messages, delay each one independently by an additional random
30 /// amount to avoid issuing a new request for all messages at the same time.
31 ///
32 /// Senders that cause problems risk being blacklisted.
33 ServerError(String),
34}