Skip to content

Commit

Permalink
Merge pull request #1 from kirkshoop/callonerror
Browse files Browse the repository at this point in the history
how-to-call-on-error-on-a-custom-rxcpp-operator
  • Loading branch information
cipriancaba committed Feb 6, 2017
2 parents 35cb23c + 4628c01 commit 64cfdbc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/SimpleOperators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
function<observable<json>(observable<string>)> SimpleOperators::convertFromStringToJson() {
return [](observable<string> $str) {
return $str |
Rx::map([](const string s) {
return json::parse(s);
Rx::map([](const string& s) {
return json::parse(s);
}) |
Rx::on_error_resume_next([](std::exception_ptr){
return Rx::error<json>(runtime_error("custom exception"));
});
};
}
Expand Down

0 comments on commit 64cfdbc

Please sign in to comment.