You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the implementation adds the error object as parameter when raising an error via the error() method.
While that sounds like a good idea at first glance in combination with overridden __tostring and __concat methods, this tactic fails where no explict or implicit type conversion happens.
So while an error is correctly printed for example, using a gmatch on a throw error will fail, complaining that the parameter was a table where a string was expected.
It is safer to explicity call tostring() and raising the result as an error.
Acceptance Criteria
raise() method raises error with generated error message as parameter instead of the error object.
The text was updated successfully, but these errors were encountered:
Situation
Currently the implementation adds the error object as parameter when raising an error via the
error()
method.While that sounds like a good idea at first glance in combination with overridden
__tostring
and__concat
methods, this tactic fails where no explict or implicit type conversion happens.So while an error is correctly printed for example, using a
gmatch
on a throw error will fail, complaining that the parameter was a table where a string was expected.It is safer to explicity call
tostring()
and raising the result as an error.Acceptance Criteria
raise()
method raises error with generated error message as parameter instead of the error object.The text was updated successfully, but these errors were encountered: