Exception handling in RPC & WebApps

This commit is contained in:
Tomasz Drwięga
2016-04-23 12:29:12 +02:00
parent 11b0daf6cb
commit 8956d7e02b
9 changed files with 47 additions and 18 deletions

View File

@@ -85,7 +85,9 @@ impl PanicHandler {
Ok(result)
}
fn notify_all(&self, r: String) {
/// Notifies all listeners in case there is a panic.
/// You should use `catch_panic` instead of calling this method explicitly.
pub fn notify_all(&self, r: String) {
let mut listeners = self.listeners.lock().unwrap();
for listener in listeners.deref_mut() {
listener.call(&r);