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

Version 2.1.4 Regression - Catching DioError doesn't work #309

Closed
liviuls opened this issue May 21, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@liviuls
Copy link

commented May 21, 2019

Hi, since version 2.1.4 catching DioError doesn't work anymore. I've written a unit test that fails, but should pass, using the syntax in the documentation:

import 'package:flutter_test/flutter_test.dart';
import 'package:dio/dio.dart';

void main() {
  test("dio error test", () async {
    final dio = Dio();

    bool hasError = false;

    try {
      await dio.get("https://wendux.github.io/xsddddd");

      hasError = false;
    } on DioError catch (e) {
      hasError = true;
    }

    expect(hasError, true);
  });
}
@wendux

This comment has been minimized.

Copy link
Member

commented May 22, 2019

fixed, please upgrade to v2.1.5, and try again.

@liviuls

This comment has been minimized.

Copy link
Author

commented May 22, 2019

It's working with 2.1.5. Thank you! Awesome job on the library btw!

@passsy

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

@wendux can you push the code to 2.1.5? I'd like to PR another fix.

@passsy passsy referenced this issue May 23, 2019

Merged

Throw exceptions #311

@wendux wendux closed this in #311 May 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.