This is our task function. It produces objects of type task_result, but it may fail.
| 42 | // This is our task function. It produces objects of type task_result, but it |
| 43 | // may fail. |
| 44 | task_result task() |
| 45 | { |
| 46 | bool succeed = (rand()%4) != 0; //...at random. |
| 47 | if( succeed ) |
| 48 | return { }; |
| 49 | else |
| 50 | leaf::throw_exception( |
| 51 | e_thread_id{std::this_thread::get_id()}, |
| 52 | e_failure_info1{"info"}, |
| 53 | e_failure_info2{42} ); |
| 54 | }; |
| 55 | |
| 56 | int main() |
| 57 | { |
nothing calls this directly
no test coverage detected