introduce errors with info (#1834)

This commit is contained in:
Bernhard Schuster authored and GitHub committed 2020-10-27 08:10:03 +01:00
1 parent 40ea09389c
commit f345123748
58 files changed
+1983 -2030

No files matched your search

@@ -16,6 +16,8 @@
//! Utilities for testing subsystems.
#![warn(missing_docs)]
use polkadot_node_subsystem::messages::AllMessages;
use polkadot_node_subsystem::{
FromOverseer, SubsystemContext, SubsystemError, SubsystemResult, Subsystem,
@@ -169,7 +171,8 @@ impl<M: Send + 'static, S: SpawnNamed + Send + 'static> SubsystemContext
}
async fn recv(&mut self) -> SubsystemResult<FromOverseer<M>> {
self.rx.next().await.ok_or(SubsystemError)
self.rx.next().await
.ok_or_else(|| SubsystemError::Context("Receiving end closed".to_owned()))
}
async fn spawn(