mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-01-11 22:40:36 +00:00
fix: improve error handling for Cloudflare bypass failures
This commit is contained in:
parent
8fe910900b
commit
76645d97c1
2 changed files with 4 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue