| 272 | } |
| 273 | |
| 274 | void dut_sqlite::test(const std::string &stmt) |
| 275 | { |
| 276 | alarm(6); |
| 277 | rc = sqlite3_exec(db, stmt.c_str(), dut_callback, 0, &zErrMsg); |
| 278 | if( rc!=SQLITE_OK ){ |
| 279 | try { |
| 280 | if (regex_match(zErrMsg, e_syntax)) |
| 281 | throw dut::syntax(zErrMsg); |
| 282 | else if (regex_match(zErrMsg, e_user_abort)) { |
| 283 | sqlite3_free(zErrMsg); |
| 284 | return; |
| 285 | } else |
| 286 | throw dut::failure(zErrMsg); |
| 287 | } catch (dut::failure &e) { |
| 288 | sqlite3_free(zErrMsg); |
| 289 | throw; |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 |