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
Can this library make doing something simpler?
Came across this exception today in LessThanEqualRule, and ended up spending a bit of time trying to work out which of the many comparisions where actually causing this.
I was thinking that this could have been sped up if the exception included the values numberA & numberb, as this would have helped zero in on the culprit faster:
`
private string AsString(decimal? number) => number.HasValue ? number.ToString() : "null";
if (numberA == null || numberB == null)
throw new JsonLogicException($"Cannot compare {a.JsonType()}:{AsString(numberA)} and {b.JsonType()}:{AsString(numberB)}.");
`
I realise that at least one of them will be null, but one may not.
If you are happy with that, we can raise a PR to make this change.
Regards,
Dave
The text was updated successfully, but these errors were encountered:
I think this is in conflict with #377, which, if implemented, should remove all of those exceptions. I'm not sure. There's a lot of research that needs to go into that one to find out the behavior of the the JS implementation. Between the two, I would prefer to align the implementations.
However, if this can be a quick fix, I'd be happy to include this until that one can be completed.
Environment
Can this library make doing something simpler?
Came across this exception today in LessThanEqualRule, and ended up spending a bit of time trying to work out which of the many comparisions where actually causing this.
I was thinking that this could have been sped up if the exception included the values numberA & numberb, as this would have helped zero in on the culprit faster:
`
private string AsString(decimal? number) => number.HasValue ? number.ToString() : "null";
if (numberA == null || numberB == null)
throw new JsonLogicException($"Cannot compare {a.JsonType()}:{AsString(numberA)} and {b.JsonType()}:{AsString(numberB)}.");
`
I realise that at least one of them will be null, but one may not.
If you are happy with that, we can raise a PR to make this change.
Regards,
Dave
The text was updated successfully, but these errors were encountered: