Skip to content

Instantly share code, notes, and snippets.

@vadimtsushko
Created June 10, 2012 14:37
Show Gist options
  • Save vadimtsushko/2905962 to your computer and use it in GitHub Desktop.
Save vadimtsushko/2905962 to your computer and use it in GitHub Desktop.
Transform block silently swallow exeptions.
#import("dart:io");
Future getFuture() {
var completer = new Completer();
new Timer(100,(timer) => completer.complete(true));
return completer.future;
}
void main() {
getFuture().chain((_) {
print("Before exception in chain block");
throw 'Error in chain block';
print("After exception in chain block");
return getFuture();
}).then((_) {
print("Before exception in then block");
throw 'Error in then block';
print("After exception in then block");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment