Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise with string instead of object #11

Closed
redcatbear opened this issue Oct 7, 2021 · 0 comments · Fixed by #12
Closed

Raise with string instead of object #11

redcatbear opened this issue Oct 7, 2021 · 0 comments · Fixed by #12
Assignees
Labels
bug Unwanted / harmful behavior

Comments

@redcatbear
Copy link
Collaborator

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

  1. raise() method raises error with generated error message as parameter instead of the error object.
@redcatbear redcatbear added bug Unwanted / harmful behavior source:exasol labels Oct 7, 2021
@redcatbear redcatbear self-assigned this Oct 7, 2021
@redcatbear redcatbear changed the title Raise with method instead of object Raise with string instead of object Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted / harmful behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant