Only apply divide by zero protection to integers

Also allow arithmetic error to bubble up to the caller.
This commit is contained in:
Jason Turner
2015-01-09 20:06:04 -07:00
parent 8746a9eea5
commit 25b15a3449
3 changed files with 12 additions and 4 deletions

View File

@@ -93,6 +93,8 @@ namespace chaiscript
// If it's an arithmetic operation we want to short circuit dispatch
try{
return Boxed_Number::do_oper(t_oper, t_lhs, t_rhs);
} catch (const chaiscript::exception::arithmetic_error &) {
throw;
} catch (...) {
throw exception::eval_error("Error with numeric operator calling: " + t_oper_string);
}