| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b775753 commit 966404f
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -484,7 +484,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) { | |||
| 484 | 484 | mp = dlib->GetSavedModuleFromGlobalHandleMap(); | |
| 485 | 485 | if (mp == nullptr || mp->nm_context_register_func == nullptr) { | |
| 486 | 486 | dlib->Close(); | |
| 487 | - env->ThrowError("Module did not self-register."); | ||
| 487 | + char errmsg[1024]; | ||
| 488 | + snprintf(errmsg, | ||
| 489 | + sizeof(errmsg), | ||
| 490 | + "Module did not self-register: '%s'.", | ||
| 491 | + *filename); | ||
| 492 | + env->ThrowError(errmsg); | ||
| 488 | 493 | return false; | |
| 489 | 494 | } | |
| 490 | 495 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,5 +16,6 @@ require(bindingPath); | |||
| 16 | 16 | new Worker(`require(${JSON.stringify(bindingPath)})`, { eval: true }) | |
| 17 | 17 | .on('error', common.mustCall((err) => { | |
| 18 | 18 | assert.strictEqual(err.constructor, Error); | |
| 19 | - assert.strictEqual(err.message, 'Module did not self-register.'); | ||
| 19 | + assert.strictEqual(err.message, | ||
| 20 | + `Module did not self-register: '${bindingPath}'.`); | ||
| 20 | 21 | })); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,5 +19,5 @@ assert.strictEqual(module.exports.ping(), 'pong'); | |||
| 19 | 19 | // Check that after the addon is loaded with | |
| 20 | 20 | // process.dlopen() a require() call fails. | |
| 21 | 21 | console.log('require:', `./build/${common.buildType}/binding`); | |
| 22 | - const re = /^Error: Module did not self-register\.$/; | ||
| 22 | + const re = /^Error: Module did not self-register: '.*[\\/]binding\.node'\.$/; | ||
| 23 | 23 | assert.throws(() => require(`./build/${common.buildType}/binding`), re); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,5 +2,5 @@ | |||
| 2 | 2 | const common = require('../../common'); | |
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | ||
| 5 | - const re = /^Error: Module did not self-register\.$/; | ||
| 5 | + const re = /^Error: Module did not self-register: '.*[\\/]binding\.node'\.$/; | ||
| 6 | 6 | assert.throws(() => require(`./build/${common.buildType}/binding`), re); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments