diff --git a/README.md b/README.md index 1bf579b..70c8284 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,17 @@ To handle 500 errors effectively: - Log the error details for debugging purposes. - Return a user-friendly error message to the client without exposing sensitive information. +#### Enhanced Logging +Consider using a logging library to manage logs more effectively. This can help in categorizing logs, setting log levels, and storing logs in a centralized location. + Example: ```javascript app.get('/api/resource', (req, res) => { try { // Code that may throw an error } catch (error) { - console.error(error); + logger.error(error); // Using a logging library res.status(500).send('Internal Server Error'); } }); -``` \ No newline at end of file +```