module.exports = {
    GDSError: GDSError
};

function GDSError(gdsObject) {
    if (Error.captureStackTrace) {
        Error.captureStackTrace(this, this.constructor);
    } else {
        this.stack = (new Error()).stack;
    }

    this.message = gdsObject && gdsObject.message || '';
    this.code = gdsObject && gdsObject.status && gdsObject.status.length > 0 && gdsObject.status[0].gdscode || -1;
}

GDSError.prototype = Object.create(Error.prototype);
GDSError.prototype.name = 'GDSError';
@@ -74,162 +74,8 @@
 ) %7B%0A
-    if (Error.captureStackTrace) %7B%0A        Error.captureStackTrace(this, this.constructor);%0A    %7D else %7B%0A        this.stack = (new Error()).stack;%0A    %7D%0A%0A
     
@@ -241,16 +241,162 @@
 e %7C%7C -1;
+%0A%0A    if (Error.captureStackTrace) %7B%0A        Error.captureStackTrace(this, GDSError);%0A    %7D else %7B%0A        this.stack = (new Error()).stack;%0A    %7D
 %0A%7D%0A%0AGDSE
@@ -481,8 +481,9 @@
 SError';
+%0A

fix to stacktrace capture