Skip to content

Why Jint.Runtime.ExecutionCanceledException can't be caught when calling anther engine's function #1541

Answered by lahma
Zaitonn asked this question in Q&A
Discussion options

You must be logged in to vote

You need to configure engine's options ExceptionHandler.

jint/Jint/Options.cs

Lines 291 to 297 in 8b0da8a

/// <summary>
/// Exceptions that thrown from CLR code are converted to JavaScript errors and
/// can be used in at try/catch statement. By default these exceptions are bubbled
/// to the CLR host and interrupt the script execution. If handler returns true these exceptions are converted
/// to JS errors that can be caught by the script.
/// </summary>
public ExceptionHandlerDelegate ExceptionHandler { get; set; } = static exception => false;

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@lahma
Comment options

lahma Apr 28, 2023
Collaborator

@Zaitonn
Comment options

@lahma
Comment options

lahma Apr 28, 2023
Collaborator

@Zaitonn
Comment options

@Zaitonn
Comment options

Answer selected by Zaitonn
Comment options

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

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