primer cambio
This commit is contained in:
24
node_modules/amqplib/lib/error.js
generated
vendored
Normal file
24
node_modules/amqplib/lib/error.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
var inherits = require('util').inherits;
|
||||
|
||||
function trimStack(stack, num) {
|
||||
return stack && stack.split('\n').slice(num).join('\n');
|
||||
}
|
||||
|
||||
function IllegalOperationError(msg, stack) {
|
||||
var tmp = new Error();
|
||||
this.message = msg;
|
||||
this.stack = this.toString() + '\n' + trimStack(tmp.stack, 2);
|
||||
this.stackAtStateChange = stack;
|
||||
}
|
||||
inherits(IllegalOperationError, Error);
|
||||
|
||||
IllegalOperationError.prototype.name = 'IllegalOperationError';
|
||||
|
||||
function stackCapture(reason) {
|
||||
var e = new Error();
|
||||
return 'Stack capture: ' + reason + '\n' +
|
||||
trimStack(e.stack, 2);
|
||||
}
|
||||
|
||||
module.exports.IllegalOperationError = IllegalOperationError;
|
||||
module.exports.stackCapture = stackCapture;
|
||||
Reference in New Issue
Block a user