Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trycatch

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trycatch - npm Package Compare versions

Comparing version 1.5.5 to 1.5.6

11

lib/formatError.js

@@ -7,3 +7,9 @@ var path = require('path')

// use colors module, if available
try {colors = require('colors') } catch(err) {}
colors = (function getColors() {
if (process.stdout && process.stdout.isTTY) {
try {
return require('colors')
} catch(err) {}
}
})()

@@ -87,3 +93,4 @@ function formatError(err, stack, options) {

if (line && line.indexOf(options.filter[j]) !== -1) {
line = ''
line = null
break
}

@@ -90,0 +97,0 @@ }

42

lib/trycatch.js

@@ -64,21 +64,21 @@ var domain = require('domain')

function _trycatchOnError(e) {
e = coerceToError(e)
if (!e.normalized) e.stack = formatError(e, e.stack)
function _trycatchOnError(err) {
err = coerceToError(err)
if (!err.normalized) err.stack = formatError(err, err.stack)
if (!e.catchable) {
if (!err.catchable) {
// Most likely a domain "caught" error
d.exit()
throw e
throw err
}
if (e.caught) {
addNonEnumerableValue(e, 'rethrown', true)
} else addNonEnumerableValue(e, 'caught', true)
if (err.caught) {
addNonEnumerableValue(err, 'rethrown', true)
} else addNonEnumerableValue(err, 'caught', true)
if (isLST) {
if (e.rethrown) {
if (e.parentStack) {
e.stack += delimitter + e.parentStack
e.parentStack = undefined
if (err.rethrown) {
if (err.parentStack) {
err.stack += delimitter + err.parentStack
err.parentStack = undefined
}

@@ -88,5 +88,5 @@ }

if (parentStack) {
if (e.parentStack) e.parentStack = parentStack
if (err.parentStack) err.parentStack = parentStack
else {
addNonEnumerableValue(e, 'parentStack', parentStack)
addNonEnumerableValue(err, 'parentStack', parentStack)
}

@@ -97,3 +97,3 @@ }

d.exit()
handleException(e, parentDomain, catchFn)
handleException(err, parentDomain, catchFn)
}

@@ -165,4 +165,4 @@ }

tryFn.apply(args[0], args[1])
} catch(e) {
return e
} catch(err) {
return err
}

@@ -175,4 +175,4 @@ }

tryFn.call(null, arg)
} catch(e) {
return e
} catch(err) {
return err
}

@@ -185,4 +185,4 @@ }

tryFn()
} catch(e) {
return e
} catch(err) {
return err
}

@@ -189,0 +189,0 @@ }

{
"name": "trycatch",
"version": "1.5.5",
"version": "1.5.6",
"description": "An asynchronous domain-based exception handler with long stack traces for node.js",

@@ -5,0 +5,0 @@ "homepage": "http://github.com/CrabDude/trycatch",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc