New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.1.1 to 1.2.0

32

lib/trycatch.js

@@ -9,2 +9,3 @@ var util = require('util')

, delimitter = '\n ----------------------------------------\n'
, originalError = global.Error
, hasGuardedWithoutLST

@@ -68,6 +69,5 @@ , options

}
} else if (trycatch.currentStack) {
e.stack += delimitter + trycatch.currentStack
}
}
e = formatError(e)

@@ -118,3 +118,3 @@

obj = {}
Error.captureStackTrace(obj)
originalError.captureStackTrace(obj)
stack = obj.stack.substr(16)

@@ -222,5 +222,5 @@

// No longer necessary, but nice to have
Error.stackTraceLimit = Infinity
originalError.stackTraceLimit = Infinity
} else {
Error.stackTraceLimit = 10
originalError.stackTraceLimit = 10
}

@@ -257,2 +257,24 @@ options['long-stack-traces'] = opts['long-stack-traces']

function Error(message) {
var err = new originalError(message)
err.__proto__ = this.__proto__
if (options['long-stack-traces'] && trycatch.currentStack) {
err.stack += delimitter + trycatch.currentStack
}
// formatError(err)
return err
}
Error.__proto__ = originalError
util.inherits(Error, originalError)
global.Error = Error
Object.defineProperty(Error, 'prepareStackTrace', {
get: function() {return originalError.prepareStackTrace}
, set: function(v) {originalError.prepareStackTrace = v}
})
Object.defineProperty(Error, 'stackTraceLimit', {
get: function() {return originalError.stackTraceLimit}
, set: function(v) {originalError.stackTraceLimit = v}
})
// Pass callback wrapping function to hookit

@@ -259,0 +281,0 @@ hookit(wrap)

2

package.json
{
"name": "trycatch",
"version": "1.1.1",
"version": "1.2.0",
"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