Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Lua runtime errors during extraction #1467

Closed
systemed opened this issue May 10, 2015 · 1 comment
Closed

Show Lua runtime errors during extraction #1467

systemed opened this issue May 10, 2015 · 1 comment
Milestone

Comments

@systemed
Copy link
Member

At present Lua runtime errors encountered during extraction just throw a generic "Lua runtime error".

During contraction, however, the runtime error is reported fully:

if (0 != luaL_dofile(lua_state, profile_path.string().c_str()))
{
    std::cerr << lua_tostring(lua_state, -1) << " occured in scripting block" << std::endl;
    return false;
}

I think OSRM used to show Lua errors during extraction too - I found this code in an old version:

try {
    ...
} catch (const luabind::error &er) {
    std::cerr << er.what() << std::endl;
    lua_State* Ler = er.state();
    report_errors(Ler, -1);
}

...
void BaseParser::report_errors(lua_State *L, const int status) const {
    if( 0!=status ) {
        std::cerr << "-- " << lua_tostring(L, -1) << std::endl;
        lua_pop(L, 1); // remove error message
    }
}
@TheMarex
Copy link
Member

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants