Open emiltin opened 8 years ago
Yep, this is an issue. Makes it hard to implement features in Lua.
What could help is https://github.com/Project-OSRM/osrm-backend/issues/3013 with proper error handling. At the moment there are just classes of errors that are hard to impossible to catch for us, e.g. assigning Lua nil to a bounded object's std::string
member (undefined behavior, hopefully just crashes).
Now that https://github.com/Project-OSRM/osrm-backend/pull/3382 is more or less complete, we can revisit this ticket. @karenzshea would you be so kind to test what happens if you add syntax errors to the car profile run the cucumber test suite.
From what I'm reading here we should get an exception: https://sol2.readthedocs.io/en/latest/errors.html
Just had a look when rebasing the sol2 branch, this is the error message from the exception sol2 throws:
terminate called after throwing an instance of 'sol::error' what(): lua: error: /tmp/osrm-backend/profiles/car.lua:13: syntax error near 'barrier_whitelist'
I put some garbage next to the barrier whitelist. Not too bad in my opinion.
But this is only in test/logs/car/
, the Cucumber output does not show this directly.
Next action here:
On error Cucumber has to check and propagate the message osrm-extract's output to the user.
Working on rebasing/updating ##2032, I found that LUA errors (eg. syntax errors or nil objects) are not reported when running cucumber tests, nor are there any reference to LUA file or line number. All I get is a generic 'osrm-extract killed'. This makes working on LUA profiles and refactoring hard.
Example