Add examples for `on_error` method