monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
633 stars 147 forks source link

provide more info on script errors #358

Closed pq closed 6 years ago

pq commented 6 years ago

From @pq on May 22, 2018 22:36

currently (at least some) script errors provide very little information to the REPL (e.g., ### SCRIPT ERROR and nothing more). if we're trapping the error it'd be great to pass more back (in the repl or log).

a few observations:

to reproduce, put this into an init() and play:

local a = nil
print(a.tostring())

result:

# script run
# script init
### SCRIPT ERROR:

Copied from original issue: ngwese/maiden#82

pq commented 6 years ago

/cc @catfact

pq commented 6 years ago

From @catfact on May 22, 2018 22:38

norns.scripterror() is called with no arguments here: https://github.com/catfact/norns/blob/dev/lua/script.lua#L41

this should probably use norns.try (as far as i can tell)

this functionality seems messy and error-prone to me - interdependency on script.lua, menu.lua and norns.lua

pq commented 6 years ago

From @ngwese on May 22, 2018 22:39

i think this would be better filed against matron in the norns repo - maiden has no control over this as the repl is just echos whatever is sent over the socket

pq commented 6 years ago

@catfact should this get moved to the norns repo?

pq commented 6 years ago

From @catfact on May 22, 2018 22:39

yes i agree

pq commented 6 years ago

From @catfact on May 22, 2018 22:39

this stuff is also printed to the norns screen... sometimes? maybe?

antonhornquist commented 6 years ago

agreed this is important. must have been a quite recent change causing lua errors not to be reported in detail - there used to be stack traces.