This commit is contained in:
Radek Davidek 2026-03-04 14:34:10 +01:00
parent de7d38c596
commit 52f3af0758

View File

@ -283,6 +283,11 @@ public final class XtreamPlayerApplication {
break;
}
} catch (Exception candidateException) {
if (candidateException instanceof InterruptedException) {
Thread.currentThread().interrupt();
writeJson(exchange, 500, errorJson("Stream proxy interrupted."));
return;
}
attemptErrors.add(maskUri(candidate) + " -> " + compactError(candidateException));
LOGGER.warn("Stream proxy candidate failed uri={}", maskUri(candidate), candidateException);
}
@ -317,9 +322,6 @@ public final class XtreamPlayerApplication {
copyResponseHeaderIfPresent(response, exchange, "Expires");
exchange.getResponseHeaders().set("Content-Type", contentType);
writeBytes(exchange, response.statusCode(), body, contentType);
} catch (InterruptedException interruptedException) {
Thread.currentThread().interrupt();
writeJson(exchange, 500, errorJson("Stream proxy interrupted."));
} catch (Exception exception) {
LOGGER.error("Stream proxy failed for {}", maskUri(target), exception);
writeJson(exchange, 502, errorJson("Unable to proxy stream: " + exception.getMessage()));