UNPKG
catch.js
Version:
latest (0.1.0)
0.1.0
0.0.1
Catch and handle errors after deployment
github.com/arguiot/Catch
arguiot/Catch
catch.js
/
src
/
functions
/
node.js
13 lines
(12 loc)
•
195 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
node
(
handler
) {
if
(process) { process.
on
(
'uncaughtException'
,
err
=>
{
const
obj = {
err
: err,
time
:
new
Date
().
toString
() }
this
.
errors
.
push
(obj)
handler
(obj) }); } }