-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Closed
Labels
Description
Feature and motivation
await context.Script.CallFunctionAsync("() => { return ['hi']; }", false);It throws an .Net exception rather than returning EvaluateResult BiDi object.
script.EvaluateResult = (
script.EvaluateResultSuccess /
script.EvaluateResultException
)
Now, .Net methods throw if the result is EvaluateResultException. It is not ideal, low-level binding should not introduce additional logic on top of specification.
Why:
- We are hiding all data included into
EvaluateResultException, trying to include it in .Net Exception type. - If in future new derived type will be introduced in the spec (like "PartiallySuccess"), then we will be in **s (problematic situation)
Usage example
Before:
public Task<EvaluateResult.Success> CallFunctionAsync(...)After:
public Task<EvaluateResult> CallFunctionAsync(...)NOTE: Keeping in mind implicit/explicit type conversions in .NET.
Reactions are currently unavailable