This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
dimitriye98's profile picture

Stack Trace

Started by dimitriye98, 02 June 2015 - 10:13 PM
dimitriye98 #1
Posted 03 June 2015 - 12:13 AM
Would it be possible to implement stack traces? It's somewhat bothersome that none are present. Obviously, the issue is that pcall only gives the original error, but would a native os.pcall which gives a stack trace be possible, with the shell using that instead of lua's pcall?

An alternative would be implementing a limited selection of functions from the debug library, namely debug.traceback() in a sandboxed way (discarding any traceback above the computer's bios's level), which could then be used with xpcall.
Edited on 02 June 2015 - 11:09 PM
theoriginalbit #2
Posted 03 June 2015 - 02:58 AM
It is possible to build your own stack trace with error, pcall, and throwback levels… however I do agree that something like this natively would be nice.
ElvishJerricco #3
Posted 03 June 2015 - 04:53 AM
It is possible to build your own stack trace with error, pcall, and throwback levels… however I do agree that something like this natively would be nice.

This doesn't, however, work with bytecode level errors, such as attempting to index nil.