Skip to content

Commit

Permalink
Support for undefined function raising an exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
waTeim committed Sep 17, 2014
1 parent cdd17f5 commit 98179a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ nj::Result nj::Call::eval(vector<shared_ptr<nj::Value>> &args)

if(!func) func = jl_get_function(jl_base_module,funcName.toString().c_str());
if(!func) func = jl_get_function(jl_main_module,funcName.toString().c_str());
if(!func) return res;
if(!func)
{
shared_ptr<Exception> ex = shared_ptr<Exception>(new JuliaMethodError(string("Julia method ") + funcName.toString() + " is undefined"));

return Result(ex);
}

if(numArgs <= 3)
{
Expand Down

0 comments on commit 98179a6

Please sign in to comment.