Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions error.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ module.exports = function createError (name, parameters, Constructor) {
// Set up the custom properties for this Error object, if specified.
// Create a new stack descriptor that includes the stacks for any errors
// also passed in
function createStackDescriptor (errors, previous) {
function createStackDescriptor (errors, previous, proxy) {
return function () {
var stack = previous.get();
var stack = previous.get.call(proxy);
errors.forEach(function (error) {
stack += '\n';
stack += error.stack;
Expand Down Expand Up @@ -85,7 +85,7 @@ module.exports = function createError (name, parameters, Constructor) {
// descriptor that includes the other error stacks
if (errors.length > 0) {
properties.stack = {
'get' : createStackDescriptor(errors, stackDescriptor)
'get' : createStackDescriptor(errors, stackDescriptor, proxy)
};
}
// Always set the message manually, in case there was a default supplied
Expand Down