diff --git a/index.js b/index.js index c0632398e..22109aa96 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ module.exports = { constants: require('./lib/constants'), db: require('./lib/db'), errors: require('./lib/errors.js'), + errorUtils: require('./lib/errorUtils'), shuffle: require('./lib/shuffle'), stringHash: require('./lib/stringHash'), ipCheck: require('./lib/ipCheck'), diff --git a/lib/errorUtils.js b/lib/errorUtils.js new file mode 100644 index 000000000..cb11be5b0 --- /dev/null +++ b/lib/errorUtils.js @@ -0,0 +1,12 @@ +function reshapeExceptionError(error) { + return { + message: error.message, + code: error.code, + stack: error.stack, + name: error.name, + }; +} + +module.exports = { + reshapeExceptionError, +}; diff --git a/package.json b/package.json index 383d32e6c..bea504609 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "engines": { "node": ">=8" }, - "version": "8.0.2", + "version": "8.0.3", "description": "Common utilities for the S3 project components", "main": "index.js", "repository": {