Skip to content

Commit

Permalink
These errors from the bytecode are actually compile errors, not runti…
Browse files Browse the repository at this point in the history
…me errors
  • Loading branch information
Toon Schoenmakers committed Mar 6, 2015
1 parent 4acef6e commit 33291c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/template.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Template
* Constructor
* @param source Source of your template
*
* @throws std::runtime_error In case JIT compilation failed, the what() will describe what and where it went wrong
* @throws CompileError In case JIT compilation failed, the what() will describe what and where it went wrong
*/
Template(const Source &source);

Expand Down
8 changes: 4 additions & 4 deletions src/bytecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jit_type_t Bytecode::_function_signature = jit_function::signature_helper(jit_ty

/**
* Constructor
* @param source The source that holds the template
* @throws std::runtime_error If something went wrong while compiling the jit code
* @param source The source that holds the template
* @throws CompileError If something went wrong while compiling the jit code
*/
Bytecode::Bytecode(const Source& source) : _tree(source.data(), source.size()),
_function(_context, _function_signature),
Expand Down Expand Up @@ -834,7 +834,7 @@ void Bytecode::parameters(const Parameters *parameters)
_callbacks.params_append_double(_userdata, params, doubleExpression(param.get()));
break;
default:
throw RunTimeError("Unknown typed values are currently unsupported");
throw CompileError("Unknown typed values are currently unsupported");
}
}

Expand Down Expand Up @@ -966,7 +966,7 @@ void Bytecode::assign(const std::string &key, const Expression *expression)
_callbacks.assign(_userdata, key_str, key_size, pointer(variable));
break;
}
throw RunTimeError("Unsupported assign");
throw CompileError("Unsupported assign");
}
case Expression::Type::Double:
// Convert to a floating point and use the assign_double callback
Expand Down

0 comments on commit 33291c9

Please sign in to comment.