增加uncaughtException事件监听

v1 1.1.3
yutent 2022-12-21 11:47:18 +08:00
parent a135007f35
commit 9a7421c4af
2 changed files with 6 additions and 4 deletions

View File

@ -23,12 +23,14 @@ import Cors from './middleware/cors.js'
function hideProperty(host, name, value) { function hideProperty(host, name, value) {
Object.defineProperty(host, name, { Object.defineProperty(host, name, {
value: value, value: value,
writable: true, enumerable: false
enumerable: false,
configurable: true
}) })
} }
process.on('uncaughtException', err => {
console.error('UncaughtException: ', err)
})
export default class Five { export default class Five {
constructor() { constructor() {
hideProperty(this, '__FIVE__', config) hideProperty(this, '__FIVE__', config)

View File

@ -1,6 +1,6 @@
{ {
"name": "@gm5/core", "name": "@gm5/core",
"version": "1.1.2", "version": "1.1.3",
"type": "module", "type": "module",
"description": "Five.js, 一个轻量级的nodejs mvc框架 旨在简单易用, 5分钟即可上手", "description": "Five.js, 一个轻量级的nodejs mvc框架 旨在简单易用, 5分钟即可上手",
"author": "yutent <yutent.io@gmail.com>", "author": "yutent <yutent.io@gmail.com>",