Mudlet / Mudlet

⚔️ A cross-platform, open source, and super fast MUD client with scripting in Lua
https://mudlet.org
GNU General Public License v2.0
738 stars 268 forks source link

Lua runtime error messages aren't captured until error view is opened #7317

Closed vadi2 closed 4 months ago

vadi2 commented 4 months ago

Brief summary of issue / Description of requested feature:

The error view doesn't capture Lua runtime error messages until the error view is opened.

Steps to reproduce the issue / Reasons for adding feature:

  1. run lua 2+
  2. open errors view
  3. expect to see syntax error in the errors view

Error output / Expected result of feature

No runtime errors are logged, not until the error view is opened.

Extra information, such as the Mudlet version, operating system and ideas for how to solve / implement:

4.18.2

wiploo commented 4 months ago

Confirmed with windows 10/11 on 4.18.2.

SlySven commented 4 months ago

Hang on - this is a natural consequence of #7215 which doesn't create the editor (and thus the "error" console within it) until the editor is opened. So either you'll have to revert that - or find a way to either stash all the text that would have gone there (maybe in a Buffer type TConsole instance and then move the data from there into the TBuffer of the error console when the editor and it are created).

:bulb: OTOH if you can do that then the same principle could be applied to the Central Debug Console - as that suffers from the same limitation in that it does not show text prior to the point at which it is opened...

ZookaOnGit commented 4 months ago

Simplify in pursuit of v5 (user friendliness) and just show all Lua errors to the main console. Lose a widget and a preference knob along the way which are arguably not required. Default packages should be tight enough to not raise Lua errors and handle any problems gracefully.

Or create the editor window/error console when the first error is raised.

wiploo commented 4 months ago

Hi, a package shouldn't have lua error, but it's quite impossible.

I think that the debug console is quite verbose, so it can be populated only when it is manually opened. Error console instead usually group a few or none informations, but they are very useful and compact, and Mudlet should handle them even if no one has voluntarily opened the console.

The first question that I made to users when they contacted me for a package problem was: Do you see any errors in the error console?

vadi2 commented 4 months ago

@ZookaOnGit unfortunately, player made packages aren't always clean, and a newbie could easily install a few packages for their game that will spam the errors in the main window - and that won't be nice.

vadi2 commented 4 months ago

I'll revert https://github.com/Mudlet/Mudlet/pull/7215 for now as the speed gains aren't worth the effort reimplementing a different way to store the errors ATM.

vadi2 commented 3 months ago

This is fixed in 4.18.3.