fix(worker): Base-URL ohne Schema laesst die Ticket-Anbindung scheitern

Ein blanker Hostname ist eine relative URI; HttpClient lehnt sie mit
InvalidOperationException ab. Die lief an dem zu engen catch-Filter
vorbei, flog roh aus dem Hub und wurde von TryInvokeAsync zu null
verschluckt - die UI meldete "Worker not reachable", obwohl der Worker
lief und die Ursache eine Eingabe war.

- TicketSystemConfig ergaenzt fehlendes http://
- BandelTicketClient uebersetzt jede Transport-Exception in eine
  lesbare TicketApiException
- TestTicketConnection faengt alles und antwortet mit dem Grund
- GetTicketSettings liefert die effektive URL, damit die Ergaenzung
  sichtbar ist
This commit is contained in:
mika kuns
2026-08-27 14:03:52 +02:00
parent 2fe2ac83b1
commit 3322152b9c
6 changed files with 95 additions and 8 deletions
@@ -13,12 +13,22 @@ internal sealed class StubHandler : HttpMessageHandler
public readonly List<string> Bodies = new();
private readonly Func<HttpRequestMessage, (HttpStatusCode, string)> _respond;
private readonly Exception? _throw;
public StubHandler(Func<HttpRequestMessage, (HttpStatusCode, string)> respond) => _respond = respond;
/// <summary>Lets a test reproduce a transport that blows up instead of answering.</summary>
public StubHandler(Exception throwOnSend)
{
_respond = _ => (HttpStatusCode.OK, "");
_throw = throwOnSend;
}
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken ct)
{
Requests.Add(request);
Bodies.Add(request.Content is null ? "" : await request.Content.ReadAsStringAsync(ct));
if (_throw is not null) throw _throw;
var (code, body) = _respond(request);
return new HttpResponseMessage(code) { Content = new StringContent(body, Encoding.UTF8, "application/json") };
}