We have a cloud function which creates a Client object but sometimes it can fail so we have
try
{
/// here we try to create some Client object and it fails in beforeSave (we throw ‘some error’
}catch(error){
// here error isn’t just ‘some error’ but also
'Received an error with invalid JSON from Parse: Error: some error.< br > at error (/opt/server/node_modules/parse-server/lib/triggers.js:379:16)
at process._tickCallback (internal/process/next_tick.js:68:7)
}
How to avoid that strange mix of html and our throw message, stripping it out manually sounds like a bit bad pattern. We want to get that throw message and pass it as a response to the client.