Skip to content

Commit 2b7785b

Browse files
authored
Include inner message in exception thrown from JS thread (#378)
1 parent 0056dbd commit 2b7785b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/NodeApi/JSException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public JSException(JSError error) : base(error.Message)
4343
/// This constructor must be called while still on the JS thread.
4444
/// </remarks>
4545
internal JSException(Exception innerException)
46-
: this("Exception thrown from JS thread. See inner exception for details.", innerException)
46+
: this("Exception thrown from JS thread: " + innerException?.Message, innerException)
4747
{
4848
JSException? innerJSException = innerException as JSException;
4949
JSValue? jsError = innerJSException?.Error?.Value;

test/NodejsEmbeddingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public void ErrorPropagation()
214214
});
215215
});
216216

217-
Assert.StartsWith("Exception thrown from JS thread.", exception.Message);
217+
Assert.Equal("Exception thrown from JS thread: test", exception.Message);
218218
Assert.IsType<JSException>(exception.InnerException);
219219

220220
exception = (JSException)exception.InnerException;

0 commit comments

Comments
 (0)