Skip to content
Discussion options

You must be logged in to vote

FOr anyone who is trying to do this, wrap the evaluate method in a try catch and catch JavaScriptException, it has a Location property

I did not need to modify engine options.

            try
            {
                workflowContext.LastResult = await _scriptEvaluator.EvaluateAsync(Script, workflowContext, new OutcomeMethodProvider(outcomes));

            }
            catch (JavaScriptException ex)
            {
                // throw custom exception
                throw new InvalidOperationException(string.Format("Error at Line:{0} Column: {1} | {2}",
                    ex.Location.Start.Line,
                    ex.Location.Start.Column,
                    ex.Message), ex);…

Replies: 4 comments 12 replies

Comment options

You must be logged in to vote
1 reply
@weirdyang
Comment options

Comment options

You must be logged in to vote
8 replies
@hyzx86
Comment options

@weirdyang
Comment options

@hyzx86
Comment options

@weirdyang
Comment options

@hyzx86
Comment options

Comment options

You must be logged in to vote
3 replies
@hyzx86
Comment options

@weirdyang
Comment options

@hyzx86
Comment options

Answer selected by weirdyang
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants