Server wide custom error messages

In my app the error ParseError: 101 Object not found is almost certainly caused by someone not having permissions to view that object due to ACL. So I would like to be able to update this error message (without forking the core) to a custom error message.

I am aware that custom error messages are now possible. However, this would not necessarily be able to be done when the error is likely to be thrown in beforeSave? I don’t want to query for presence first and then update as I am firing this request via the REST API (including the objectId)

Any ideas?

I’d try to set enableExpressErrorHandler option to true and add another Express.js middleware after Parse. In this middleware you can verify the error and probably you will be able to send another message. This teste case does not do exactly what you need but it can give you some clue.

1 Like

Thank you! I will have a go.