Skip to content

Commit 110ff31

Browse files
committed
Give better error messages when port_set.recv fails.
1 parent ce6d651 commit 110ff31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libcore/pipes.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,10 @@ struct port_set<T: send> : recv<T> {
899899
}
900900

901901
fn recv() -> T {
902-
option::unwrap(self.try_recv())
902+
match move self.try_recv() {
903+
some(x) { move x }
904+
none { fail ~"port_set: endpoints closed" }
905+
}
903906
}
904907

905908
pure fn peek() -> bool {

0 commit comments

Comments
 (0)