trycatch:基于异步域的异常处理程序,具有对node.js的长堆栈跟踪

时间:2021-02-19 18:13:45
【文件属性】:
文件名称:trycatch:基于异步域的异常处理程序,具有对node.js的长堆栈跟踪
文件大小:39KB
文件格式:ZIP
更新时间:2021-02-19 18:13:45
JavaScript 试着抓 基于域的异步try / catch,具有node.js的(可选)长堆栈跟踪。 警告:trycatch替换内置的全局Error对象。 安装 npm install trycatch 使用 var trycatch = require ( 'trycatch' ) trycatch ( function ( ) { // do something error-prone } , function ( err ) { console . log ( err . stack ) ; } ) 在服务器请求上返回500s http . createServer ( function ( req , res ) { trycatch ( function ( ) { setTimeout ( function ( ) { throw new Error (
【文件预览】:
trycatch-master
----.travis.yml(170B)
----.eslintrc(641B)
----package.json(1KB)
----test()
--------.eslintrc(660B)
--------nested.test.js(3KB)
--------event-emitter.test.js(3KB)
--------throw-non-error.test.js(2KB)
--------basic.test.js(3KB)
--------configure.test.js(3KB)
----perf.sh(142B)
----trycatch.old.js(6KB)
----LICENSE(1KB)
----screenshot.png(21KB)
----examples()
--------colors.js(535B)
--------server.js(311B)
--------underscore.js(281B)
--------setTimeout.js(284B)
--------helloworld.js(453B)
----.gitignore(12B)
----lib()
--------FormatStackTrace.js(533B)
--------trycatch.js(10KB)
--------formatError.js(4KB)
----README.md(3KB)
----.jshintrc(384B)

网友评论