Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

operator_map_error

crates.io ci codecov license

Transform error values into another error value.

See Also

Example

cargo run -p rx_core --example operator_map_error_example
let _subscription = concat((
  (1..=5)
    .into_observable()
    .map_error(Never::map_into::<&'static str>()),
  throw("error").map(Never::map_into::<usize>()),
))
.skip(1)
.map_error(|error| format!("error? {error}"))
.subscribe(PrintObserver::new("map_error_operator"));

Output:

map_error_operator - next: 1
map_error_operator - next: 2
map_error_operator - next: 3
map_error_operator - next: 4
map_error_operator - next: 5
map_error_operator - error: "error? error"
map_error_operator - unsubscribed