Summary: Lua errors not reported when evaluating whole file
                 Project: Freeciv
            Submitted by: englabenny
            Submitted on: lördag 2010-03-13 den 16:16
                Category: None
                Severity: 3 - Normal
                Priority: 1 - Later
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None
         Planned Release: 



The user/developer gets no indication of what is wrong if lua evaluation
fails when evaluating default.lua or similar files.

Attached a patch to report the error in lua, just the first line but normally
exactly what you need to fix syntax/simple typos in the top level of the
script file.

(Lua errors in "non-toplevel", in callbacks are of course shown later, when
the callbacks are evaluated)

With this change we get helpful errors:

    2: Loading rulesets
    l1: lua error:
            data/default/default.lua:176: ')' expected (to close '(' at line
175) near '<eof>'
    0: "data/default/script.lua": could not load ruleset script.


File Attachments:

Date: lördag 2010-03-13 den 16:16  Name:
0001-Report-lua-errors-in-script_do_file.patch  Size: 2 kB   By: englabenny



Reply to this item at:


  Meddelandet skickades via/av Gna!

Freeciv-dev mailing list

Reply via email to