# Struct ethcore_io::PanicHandler [−] [src]

    pub struct PanicHandler { /* fields omitted */ }

Structure that allows to catch panics and notify listeners

## Methods

### `impl PanicHandler`
[src]

#### `fn new_in_arc() -> Arc<Self>`

Creates new `PanicHandler` wrapped in `Arc`

#### `fn new() -> Self`

Creates new `PanicHandler`

#### `fn catch_panic<G, R>(&self, g: G) -> Result<R> where G: FnOnce() -> R + Send + 'static`

Invoke closure and catch any possible panics. In case of panic notifies all listeners about it.

#### `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.

## Trait Implementations

### `impl Default for PanicHandler`
[src]

#### `fn default() -> Self`

Returns the "default value" for a type. Read more

### `impl MayPanic for PanicHandler`
[src]

#### `fn on_panic<F>(&self, closure: F) where F: OnPanicListener`

`closure` will be invoked whenever panic in thread is caught

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)