Comparing version 2.0.2 to 2.0.3
@@ -5,2 +5,9 @@ # Changelog | ||
## [2.0.3][] - 2021-01-29 | ||
- Fixed exception handling in module loader | ||
- Added relative path in logged stack traces | ||
- Fixed application initializtion flag | ||
- Catch exceptions in application initialization | ||
## [2.0.2][] - 2021-01-26 | ||
@@ -43,5 +50,7 @@ | ||
[unreleased]: https://github.com/metarhia/impress/compare/v2.0.1...HEAD | ||
[unreleased]: https://github.com/metarhia/impress/compare/v2.0.3...HEAD | ||
[2.0.3]: https://github.com/metarhia/impress/compare/v2.0.2...v2.0.3 | ||
[2.0.2]: https://github.com/metarhia/impress/compare/v2.0.1...v2.0.2 | ||
[2.0.1]: https://github.com/metarhia/impress/compare/v2.0.0...v2.0.1 | ||
[2.0.0]: https://github.com/metarhia/impress/compare/v1.0.9...v2.0.0 | ||
[1.0.9]: https://github.com/metarhia/impress/releases/tag/v1.0.9 |
@@ -61,3 +61,3 @@ 'use strict'; | ||
this.starts = []; | ||
this.initialization = true; | ||
this.initialization = false; | ||
} | ||
@@ -198,12 +198,11 @@ | ||
namespaces[namespaces.length - 1] = name; | ||
const options = { context: this.sandbox }; | ||
let exports = null; | ||
let iface = null; | ||
const options = { context: this.sandbox, filename: fileName }; | ||
try { | ||
const script = await metavm.readScript(fileName, options); | ||
exports = script.exports; | ||
let exports = script.exports; | ||
if (typeof exports === 'function') exports = { method: exports }; | ||
iface = metautil.makePrivate(exports); | ||
} finally { | ||
const iface = metautil.makePrivate(exports); | ||
this.addModule(namespaces, exports, iface); | ||
} catch (err) { | ||
this.console.error(err.stack); | ||
} | ||
@@ -210,0 +209,0 @@ } |
@@ -29,4 +29,10 @@ 'use strict'; | ||
const logError = (err) => { | ||
const logError = async (err) => { | ||
console.error(err ? err.stack : 'No exception stack available'); | ||
if (application.finalization) return; | ||
if (application.initialization) { | ||
console.info(`Can not start Application in worker ${threadId}`); | ||
await application.shutdown(); | ||
process.exit(0); | ||
} | ||
}; | ||
@@ -33,0 +39,0 @@ |
{ | ||
"name": "impress", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Impress application server for Node.js and Metarhia private cloud", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36963
827