use common::CoreMessage;
use maidsafe_utilities::serialisation::SerialisationError;
use mio_extras;
use std::io;
quick_error! {
#[derive(Debug)]
pub enum CommonError {
Io(e: io::Error) {
description(e.description())
display("Io error: {}", e)
cause(e)
from()
}
UninitialisedSocket {
description("Socket is uninitialised and invalid for any operation")
display("Socket is uninitialised and invalid for any operation")
}
PayloadSizeProhibitive {
description("Payload is too large")
}
Serialisation(e: SerialisationError) {
description(e.description())
display("Serialisation error: {}", e)
cause(e)
from()
}
ZeroByteRead {
description("Read zero bytes from the socket - indicates EOF")
}
CoreMsgTx(e: mio_extras::channel::SendError<CoreMessage>) {
description(e.description())
display("CoreMessage send error: {}", e)
cause(e)
from()
}
}
}