Created
June 10, 2012 14:37
-
-
Save vadimtsushko/2905962 to your computer and use it in GitHub Desktop.
Transform block silently swallow exeptions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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