| 136 | } |
| 137 | |
| 138 | InvokeResult BasicStep::invoke(const InvokeArgs* pArgs) { |
| 139 | this->pArgs = pArgs; |
| 140 | currentArgIndex = 0; |
| 141 | currentResult = InvokeResult::success(); |
| 142 | try { |
| 143 | InvokeResult returnedResult = invokeStepBody(); |
| 144 | if (currentResult.isPending()) { |
| 145 | return currentResult; |
| 146 | } else { |
| 147 | return returnedResult; |
| 148 | } |
| 149 | } catch (const std::exception& ex) { |
| 150 | return InvokeResult::failure(ex.what()); |
| 151 | } catch (const std::string& ex) { |
| 152 | return InvokeResult::failure(ex); |
| 153 | } catch (const char* ex) { |
| 154 | return InvokeResult::failure(ex); |
| 155 | } catch (...) { |
| 156 | // Cucumber needs a description here |
| 157 | return InvokeResult::failure("Unknown exception"); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | void BasicStep::pending() { |
| 162 | pending(0); |