This commit is contained in:
2026-10-21 08:54:03 +02:00
parent 4f375e6766
commit 1ce33a69d1
11 changed files with 24 additions and 17 deletions

View File

@@ -50,6 +50,7 @@ Duration _retryDelay(http.Response response, int attempt) {
return Duration(milliseconds: ms.clamp(800, 8000));
}
/// Lance une [IntraApiException] si le code HTTP n'est pas 200.
void ensureIntraOk(http.Response response) {
if (response.statusCode == 401) {
throw const IntraUnauthorizedException();
@@ -67,6 +68,7 @@ void ensureIntraOk(http.Response response) {
}
}
/// Décode le corps JSON après contrôle du statut HTTP.
dynamic decodeIntraBody(http.Response response) {
ensureIntraOk(response);
return jsonDecode(response.body);