-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
This is exactly the same request as the #52.
The use case is that I want to capture the entire error with all the causes for debugging, logging and other purposes. But when I return the JSON back to the client. I only want the user to see what is in the "jse_shortmsg".
For example:
// Example error from third-party library
const originalError = new MongoError("Duplicate keys detected")
// Example error I handle on my server
const error = VError(originalError, "Failed to update record")
// This would log: "Failed to update record: Duplicate keys detected"
logger.log(error.message)
// I only want user to see "Failed to update record"
res.json({ message: error["jse_shortmsg"] })Metadata
Metadata
Assignees
Labels
No labels