| 144 | } |
| 145 | |
| 146 | std::string ExpressionBinding::getExpressionString(bool no_throw) const |
| 147 | { |
| 148 | try { |
| 149 | if (!getExpression()) { |
| 150 | throw Base::RuntimeError("No expression found."); |
| 151 | } |
| 152 | return getExpression()->toString(); |
| 153 | } |
| 154 | catch (Base::Exception& e) { |
| 155 | if (no_throw) { |
| 156 | FC_ERR("failed to get expression string: " << e.what()); |
| 157 | } |
| 158 | else { |
| 159 | throw; |
| 160 | } |
| 161 | } |
| 162 | catch (std::exception& e) { |
| 163 | if (no_throw) { |
| 164 | FC_ERR("failed to get expression string: " << e.what()); |
| 165 | } |
| 166 | else { |
| 167 | throw; |
| 168 | } |
| 169 | } |
| 170 | catch (...) { |
| 171 | if (no_throw) { |
| 172 | FC_ERR("failed to get expression string: unknown exception"); |
| 173 | } |
| 174 | else { |
| 175 | throw; |
| 176 | } |
| 177 | } |
| 178 | return {}; |
| 179 | } |
| 180 | |
| 181 | std::string ExpressionBinding::getEscapedExpressionString() const |
| 182 | { |
nothing calls this directly
no test coverage detected