fix: improve error handling for Cloudflare bypass failures

This commit is contained in:
Moustapha Kodjo Amadou 2025-12-14 14:01:40 +01:00
parent 8fe910900b
commit 76645d97c1
2 changed files with 4 additions and 1 deletions

View file

@ -367,6 +367,9 @@ void hasError(Response response) {
final errorMessage = jsonDecode(response.body)['error'];
final code = jsonDecode(response.body)['code'];
if (errorMessage != null && code != null) {
if ((code as int) == 403) {
throw "errorMessage: Failed to bypass Cloudflare.\n\n\nYou can try to bypass it manually in the webview \n\n\nstatusCode: 403";
}
throw "errorMessage: $errorMessage \n\n\nstatusCode: $code";
}
} catch (e) {

View file

@ -244,7 +244,7 @@ class LoggerInterceptor extends InterceptorContract {
url: response.request!.url.toString(),
);
} catch (e) {
throw "${response.statusCode} Failed to bypass Cloudflare";
throw "Failed to bypass Cloudflare.\n\n\nYou can try to bypass it manually in the webview \n\n\nstatusCode: ${response.statusCode}";
}
}
}