node-api-dotnet-generator 0.2.14 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -128,8 +128,18 @@ a `Promise` returned from a .NET async method, and a JS `Promise` passed to .NET
128
128
 
129
129
  ### Error propagation
130
130
  Exceptions/errors thrown in .NET or JS are propagated across the boundary with stack traces.
131
-
132
- _Under development. More to be written..._
131
+ An unhandled .NET exception is thrown back to a JS caller as an `Error` with a stack trace that
132
+ includes both .NET and JS frames, and source line numbers if symbols are available. For example:
133
+ ```
134
+ Error: Test error thrown by JS.
135
+ at Microsoft.JavaScript.NodeApi.TestCases.Errors.ThrowDotnetError(String message) in D:\node-api-dotnet\test\TestCases\Errors.cs:line 13
136
+ at Microsoft.JavaScript.NodeApi.Generated.Module.Errors_ThrowDotnetError(JSCallbackArgs __args) in napi-dotnet.NodeApi.g.cs:line 357
137
+ at Microsoft.JavaScript.NodeApi.JSNativeApi.InvokeCallback[TDescriptor](napi_env env, napi_callback_info callbackInfo, JSValueScopeType scopeType, Func`2 getCallbackDescriptor) in JSNativeApi.cs:line 1070
138
+ at catchDotnetError (D:\node-api-dotnet\test\TestCases\errors.js:14:12)
139
+ at Object.<anonymous> (D:\node-api-dotnet\test\TestCases\errors.js:41:1)
140
+ ```
141
+ Similarly, an unhandled JS `Error` is thrown back to a .NET caller as a `JSException` with a
142
+ combined stack trace.
133
143
 
134
144
  ### Develop Node.js addons with C#
135
145
  A C# class library project can use the `[JSExport]` attribute to tag (and rename) APIs that are
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "node-api-dotnet-generator",
3
- "version": "0.2.14",
3
+ "version": "0.2.16",
4
4
  "description": "Node-API for .Net code generator",
5
5
  "main": "index.js",
6
6
  "bin": "index.js",
7
7
  "license": "MIT",
8
8
  "author": "Microsoft",
9
9
  "dependencies": {
10
- "node-api-dotnet": "0.2.14"
10
+ "node-api-dotnet": "0.2.16"
11
11
  },
12
12
  "keywords": [
13
13
  "Node-API",