Jump to content




Stack Trace


  • You cannot reply to this topic
2 replies to this topic

#1 dimitriye98

  • Members
  • 77 posts

Posted 02 June 2015 - 11:13 PM

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 by dimitriye98, 03 June 2015 - 12:09 AM.


#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 03 June 2015 - 01: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.

#3 ElvishJerricco

  • Members
  • 803 posts

Posted 03 June 2015 - 03:53 AM

View Posttheoriginalbit, on 03 June 2015 - 01:58 AM, said:

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users