-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
DioException [DioExceptionType.receiveTimeout] not working #1868
Comments
Thanks for the report. Please fill in information about what device you are using to test, and better to provide a minimal reproducible example. |
I have the same problem, I can't catch these exceptions in a try-catch either. I intentionally programmed a delay in the server, and try to catch this exception but the exception always goes to uncaught exceptions. do you know if i am doing something wrong ? const express = require('express');
const timeout = 10000;
const app = express();
app.get('/', function (req, res) {
setTimeout((function() {
res.send('Hello World')
}), timeout);
})
app.listen(8080, () => {}); final dio = Dio(
BaseOptions(
baseUrl: 'http://10.0.2.2:8080',
receiveTimeout: const Duration(seconds: 3),
)
);
try {
final response = await dio.get('/');
print(response.data);
} on DioException catch(exception) {
print('dio error: $exception');
} This is the relevant
Here is an image where the exception points me |
Is this new with 5.2.0 or something you also experienced before? |
I did some tests and it happens since version 5.2.0, with version 5.1.2 it works correctly and catches the exception. |
Then it is probably related to the changes in #1836 |
I hope that can fix this in later versions |
Could you do a |
@Velkamhell97 I think your problem should be a duplicate of #1869. |
@Apichate-Y Can you provide more details? |
This comment was marked as off-topic.
This comment was marked as off-topic.
What bad thing did I say? |
There's no bad thing, you'll need to follow up the issue I've mentioned. |
@AlexV525 In the new version I got it fixed, thank you. |
Package
dio
Version
5.2.0
Output of
flutter doctor -v
Dart Version
2.19.6
Steps to Reproduce
No
Expected Result
I set the duration but it doesn't work. The previous version is not
Actual Result
The text was updated successfully, but these errors were encountered: