Build / Desktop, server and tools (push) Successful in 1m8s
The server no longer answers 409, 413 or 429: a busy probe, a share or upload that is too large and a request over the limit now answer 400 with the same reason as before, and still say when to try again. The app reads the reason, so nothing changes for it; versions up to 0.15.4 report a limited speed test as unmeasured until they update. The app's commands can now be cancelled all the way down, and the house rules are written into PATTERNS.md and checked on every build, Android included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W4YtEJrgxG12Pc39Fai8Bd
24 lines
765 B
C#
24 lines
765 B
C#
using System.Net;
|
|
|
|
namespace MeWeb.Shared;
|
|
|
|
public class WebResult<T> where T : class
|
|
{
|
|
public T Data { get; set; }
|
|
public ViewRefusal Refusal { get; private set; }
|
|
public int StatusCode { get; private set; } = (int)HttpStatusCode.OK;
|
|
public bool IsInvalid => Refusal is not null;
|
|
public bool IsValid => Refusal is null;
|
|
|
|
public WebResult<T> Invalidate(string reason, int statusCode = (int)HttpStatusCode.BadRequest, int retryAfterSeconds = 0) =>
|
|
Invalidate(new ViewRefusal { Reason = reason, RetryAfterSeconds = retryAfterSeconds }, statusCode);
|
|
|
|
public WebResult<T> Invalidate(ViewRefusal refusal, int statusCode = (int)HttpStatusCode.BadRequest)
|
|
{
|
|
Data = null;
|
|
Refusal = refusal;
|
|
StatusCode = statusCode;
|
|
return this;
|
|
}
|
|
}
|