2026-10-03 15:26:21 +02:00
|
|
|
namespace decePubClient.Models;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// WebResult.ErrorCode values HttpService sets when a request fails before or outside the server, so the UI can tell a
|
|
|
|
|
/// connectivity problem (shown as a warning) from a real error.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class FailureCodes
|
|
|
|
|
{
|
|
|
|
|
public const string Cancelled = "CANCELLED";
|
|
|
|
|
public const string DeviceOffline = "DEVICE-OFFLINE";
|
|
|
|
|
public const string Timeout = "TIMEOUT";
|
|
|
|
|
public const string ApiUnreachable = "API-UNREACHABLE";
|
|
|
|
|
public const string RetriesExhausted = "RETRIES-EXHAUSTED";
|
|
|
|
|
public const string ServerError = "SERVER-ERROR";
|
|
|
|
|
public const string ClientError = "CLIENT-ERROR";
|
|
|
|
|
public const string Unauthorized = "UNAUTHORIZED";
|
2026-10-17 05:41:10 +02:00
|
|
|
/// <summary>PrivaPub refused the current persona a token while the login's own session is good: the staff suspended it,
|
|
|
|
|
/// or it is gone.</summary>
|
|
|
|
|
public const string PersonaRefused = "PERSONA-REFUSED";
|
2026-10-03 15:26:21 +02:00
|
|
|
|
|
|
|
|
public static bool IsConnectivity(string errorCode) =>
|
|
|
|
|
errorCode is DeviceOffline or Timeout or ApiUnreachable or RetriesExhausted;
|
|
|
|
|
}
|