collins-error
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -56,3 +56,5 @@ 'use strict'; | ||
let details = { details: error.message }; | ||
return new CoreError(type, details); | ||
let convertedError = new CoreError(type, details); | ||
convertedError.stack = error.stack; | ||
return convertedError; | ||
} | ||
@@ -59,0 +61,0 @@ } |
{ | ||
"name": "collins-error", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Custom error class used by the collins system", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -36,7 +36,10 @@ 'use strict'; | ||
}); | ||
let convertedError = CoreError.convert('TestError', foreignError); | ||
it('should convert Error into CoreError', () => { | ||
let convertedError = CoreError.convert('TestError', foreignError); | ||
Assert.equal(convertedError instanceof CoreError, true); | ||
}); | ||
it('should transfer stack trace to new error object', () => { | ||
Assert.equal(convertedError.stack, foreignError.stack); | ||
}); | ||
}); | ||
}); |
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
6310
133