Skip to content

Weird error messages from GUIUtils.lua #2890

@Kebap

Description

@Kebap

Brief summary of issue / Description of requested feature:

Have lua functions throw same sane messages the user knows and expects.

Steps to reproduce the issue / Reasons for adding feature:

  1. replaceLine() throws insertText: bad argument #1 type (text as string expected, got nil!) - but user didn't invoke that
  2. fg() throws .\mudlet-lua\lua\GUIUtils.lua:668: bad argument #2 to 'format' (string expected, got nil) - that's not even a function name
  3. getRGB("some unknown color") throws .\mudlet-lua\lua\GUIUtils.lua:439: attempt to index field '?' (a nil value)
    I didn't test all lua functions there, yet, but probably most of them got similar issues.

Error output / Expected result of feature

Compare sane errors messages in (some but not all) functions from e.g. TLuaInterpreter.cpp

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions