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

Wrench Reftests #695

Merged
merged 2 commits into from Jan 12, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

channel errors

  • Loading branch information
jrmuizel committed Jan 12, 2017
commit 68c1496f30f3bbae03dc88f3a97b25132ca0774b
@@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use serde::{Deserialize, Serialize};
use std::io::Error;
use std::io::{Error, ErrorKind};

use serde::{Deserializer, Serializer};

@@ -29,7 +29,9 @@ pub struct MsgReceiver<T> {

impl<T> MsgReceiver<T> {
pub fn recv(&self) -> Result<T, Error> {
Ok(self.rx.recv().unwrap())
use std::io;
use std::error::Error;
self.rx.recv().map_err(|e| io::Error::new(ErrorKind::Other, e.description()))
}
}

@@ -40,7 +42,7 @@ pub struct MsgSender<T> {

impl<T> MsgSender<T> {
pub fn send(&self, data: T) -> Result<(), Error> {
Ok(self.tx.send(data).unwrap())
self.tx.send(data).map_err(|_| Error::new(ErrorKind::Other, "cannot send on closed channel"))
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.