Files
project-work/worker-toolkit-potion-polyglot/repos/potion-voice/app/services/utils/logService.js
2026-10-05 16:14:53 -04:00

15 lines
388 B
JavaScript

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 }