pretty-error
Advanced tools
Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "pretty-error", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "scripts/js/lib/PrettyError.js", |
@@ -33,2 +33,9 @@ var ParsedError, PrettyError, RenderKid, array, defaultStyle, nodePaths, object, prop, _fn, _i, _len, _ref, _ref1, | ||
PrettyError.listen = function(cb) { | ||
var pe; | ||
pe = new self; | ||
pe.listen(cb); | ||
return pe; | ||
}; | ||
function PrettyError() { | ||
@@ -46,2 +53,15 @@ this._maxItems = 50; | ||
PrettyError.prototype.listen = function(cb) { | ||
process.on('uncaughtException', (function(_this) { | ||
return function(exc) { | ||
_this.render(exc, true); | ||
process.exit(1); | ||
}; | ||
})(this)); | ||
if (cb != null) { | ||
process.nextTick(cb); | ||
} | ||
return this; | ||
}; | ||
PrettyError.prototype.config = function(c) { | ||
@@ -265,41 +285,2 @@ var alias, path, _ref1; | ||
PrettyError.prototype._skipOrFilter = function(item, itemNumber) { | ||
var cb, modName, pair, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; | ||
if (typeof item === 'object') { | ||
if (_ref1 = item.modName, __indexOf.call(this._packagesToSkip, _ref1) >= 0) { | ||
return true; | ||
} | ||
if (_ref2 = item.path, __indexOf.call(this._pathsToSkip, _ref2) >= 0) { | ||
return true; | ||
} | ||
_ref3 = item.packages; | ||
for (_i = 0, _len = _ref3.length; _i < _len; _i++) { | ||
modName = _ref3[_i]; | ||
if (__indexOf.call(this._packagesToSkip, modName) >= 0) { | ||
return true; | ||
} | ||
} | ||
if (typeof item.shortenedAddr === 'string') { | ||
_ref4 = this._aliases; | ||
for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { | ||
pair = _ref4[_j]; | ||
item.shortenedAddr = item.shortenedAddr.replace(pair.stringOrRx, pair.alias); | ||
} | ||
} | ||
} | ||
_ref5 = this._skipCallbacks; | ||
for (_k = 0, _len2 = _ref5.length; _k < _len2; _k++) { | ||
cb = _ref5[_k]; | ||
if (cb(item, itemNumber) === true) { | ||
return true; | ||
} | ||
} | ||
_ref6 = this._filterCallbacks; | ||
for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) { | ||
cb = _ref6[_l]; | ||
cb(item, itemNumber); | ||
} | ||
return false; | ||
}; | ||
PrettyError.prototype.getObject = function(e) { | ||
@@ -385,2 +366,41 @@ var count, header, i, item, obj, traceItems, _i, _len, _ref1; | ||
PrettyError.prototype._skipOrFilter = function(item, itemNumber) { | ||
var cb, modName, pair, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; | ||
if (typeof item === 'object') { | ||
if (_ref1 = item.modName, __indexOf.call(this._packagesToSkip, _ref1) >= 0) { | ||
return true; | ||
} | ||
if (_ref2 = item.path, __indexOf.call(this._pathsToSkip, _ref2) >= 0) { | ||
return true; | ||
} | ||
_ref3 = item.packages; | ||
for (_i = 0, _len = _ref3.length; _i < _len; _i++) { | ||
modName = _ref3[_i]; | ||
if (__indexOf.call(this._packagesToSkip, modName) >= 0) { | ||
return true; | ||
} | ||
} | ||
if (typeof item.shortenedAddr === 'string') { | ||
_ref4 = this._aliases; | ||
for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { | ||
pair = _ref4[_j]; | ||
item.shortenedAddr = item.shortenedAddr.replace(pair.stringOrRx, pair.alias); | ||
} | ||
} | ||
} | ||
_ref5 = this._skipCallbacks; | ||
for (_k = 0, _len2 = _ref5.length; _k < _len2; _k++) { | ||
cb = _ref5[_k]; | ||
if (cb(item, itemNumber) === true) { | ||
return true; | ||
} | ||
} | ||
_ref6 = this._filterCallbacks; | ||
for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) { | ||
cb = _ref6[_l]; | ||
cb(item, itemNumber); | ||
} | ||
return false; | ||
}; | ||
return PrettyError; | ||
@@ -387,0 +407,0 @@ |
module.exports = function() { | ||
return { | ||
'pretty-error': { | ||
display: 'block' | ||
display: 'block', | ||
marginLeft: '2' | ||
}, | ||
@@ -47,2 +48,5 @@ 'pretty-error > header': { | ||
}, | ||
'pretty-error > trace > item > header > what': { | ||
color: 'white' | ||
}, | ||
'pretty-error > trace > item > footer': { | ||
@@ -49,0 +53,0 @@ display: 'block' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
51798
19
866
0
280