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

[bug] Exception is assigned to variable #81

Closed
haering opened this issue Feb 2, 2021 · 3 comments
Closed

[bug] Exception is assigned to variable #81

haering opened this issue Feb 2, 2021 · 3 comments
Assignees
Labels

Comments

@haering
Copy link
Contributor

haering commented Feb 2, 2021

Hi,

I found the bug, that if I assign the function result to a variable an exception thrown by that function will be assigned to that variable.

In the following example I would expect the Evaluate function to throw the exception and the result variable does not exist, but in the current version the exception is thrown and additionally assigned to the variable.

[Test]
public void Evaluate_WithException_ThrowsExceptionAndDoesNotAssignIt()
{
    TestConnectExpressionEvaluator evaluator = new TestConnectExpressionEvaluator();
    
    evaluator.Variables.Add("dummy", new DummyForException());
    Assert.Throws<ExpressionEvaluatorSyntaxErrorException>(() => evaluator.Evaluate("result = dummy.bang()"));
    
    Assert.That(evaluator.Variables.ContainsKey("result"), Is.False);
}

public class DummyForException
{
  public void bang()
  {
      throw new Exception();
  }
}
@codingseb codingseb added the bug label Feb 3, 2021
@codingseb codingseb self-assigned this Feb 3, 2021
@codingseb
Copy link
Owner

codingseb commented Feb 3, 2021

Hello @haering thanks for reporting this bug.
I think I know why.
I will correct it as soon as I can.

codingseb added a commit that referenced this issue Feb 3, 2021
@codingseb
Copy link
Owner

I just published version 1.4.19.0 that correct this bug.
Have a nice day

@haering
Copy link
Contributor Author

haering commented Feb 3, 2021

Thanks for your fast response and your work on this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants