dart-lang / api.dart.dev

Dart API docs
https://api.dart.dev
BSD 3-Clause "New" or "Revised" License
19 stars 17 forks source link

HttpRequest catchError parameter type and error message #29

Closed Janamou closed 9 years ago

Janamou commented 9 years ago

In the API docs for HttpRequest (https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:html.HttpRequest) is example and it has catchError part with parameter type "Error".

When I run the code and there is error (I am testing catchError part), I get: "Exception: Uncaught Error: type '_XMLHttpRequestProgressEvent' is not a subtype of type 'Error' of 'error'."

Because the type of parameter is not "Error" but "_XMLHttpRequestProgressEvent". The type "Error" should be removed from the example.

And also print(error.toString()); outputs as "Instance of '_XMLHttpRequestProgressEvent'" Better would be to have there for example: print(error.target.responseText);

alan-knight commented 9 years ago

Moved to https://code.google.com/p/dart/issues/detail?id=21497