before changes
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
const stringifyError = (error = {}) => {
|
||||
return JSON.stringify(error, Object.getOwnPropertyNames(error))
|
||||
}
|
||||
|
||||
const potionErrorObj = (error = {}, details = {}) => {
|
||||
const stringifiedError = stringifyError(error)
|
||||
const stringifiedObject = JSON.stringify({
|
||||
error: stringifiedError,
|
||||
details,
|
||||
})
|
||||
return stringifiedObject
|
||||
}
|
||||
|
||||
module.exports = { potionErrorObj, stringifyError }
|
||||
Reference in New Issue
Block a user