Skip to content

Improve error handling of parameters #37

@kaklakariada

Description

@kaklakariada

When self._parameters in MessageExpander has an invalid type (e.g. string), the expand() method will fail with the following error:

/Users/user/.luarocks/share/lua/5.4/MessageExpander.lua:37: bad argument #1 to 'next' (table expected, got string)

stack traceback:
        /Users/chp/.luarocks/share/lua/5.4/MessageExpander.lua:38: in function 'MessageExpander.expand'
        (...tail calls...)
        /Users/chp/.luarocks/share/lua/5.4/ExaError.lua:27: in function 'ExaError.__tostring'

See code: https://github.com/exasol/error-reporting-lua/blob/main/src/MessageExpander.lua#L37

Instead of failing, the code should check for the correct type before calling next().

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureProduct feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions