Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please give us an option to disable rethrow #22

Open
cristian1980 opened this issue Jul 4, 2024 · 1 comment
Open

Please give us an option to disable rethrow #22

cristian1980 opened this issue Jul 4, 2024 · 1 comment

Comments

@cristian1980
Copy link

Right now when a device has connectivity issues(airplane mode) or tries do download an inaccessible resource we are getting an exception.

E/flutter ( 6650): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioException [bad response]: This exception was thrown because the response has a status code of 403 and RequestOptions.validateStatus was configured to throw for this status code.
E/flutter ( 6650): The status code of 403 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
E/flutter ( 6650): Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
E/flutter ( 6650): In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.
E/flutter ( 6650):
E/flutter ( 6650): #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519:7)
E/flutter ( 6650):
E/flutter ( 6650): #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46:18)
E/flutter ( 6650):
E/flutter ( 6650): #2 DownloadManager.download (package:flutter_download_manager/src/downloader.dart:94:24)
E/flutter ( 6650):

I don't really see this being very useful in any way, more than that it's annoying when debugging.
You could leave it enabled by default but please give us a parameter which we can pass to DownloadManager so we can disable this exception.

@ThearyCoding
Copy link

Download the package, import it into your project, and then delete the rethrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants