errsole.js icon indicating copy to clipboard operation
errsole.js copied to clipboard

Avoid returning custom error messages from the API

Open venki91 opened this issue 1 year ago • 1 comments

Avoid returning custom error messages from the API. Instead, return the error message provided by the storage module, e.g., err.message.

venki91 avatar Jul 18 '24 09:07 venki91

Check the files here: https://github.com/errsole/errsole.js/tree/master/lib/main/server/controllers

venki91 avatar Jul 18 '24 09:07 venki91

Hi @venki91,

I'd like to work on the issue you raised about avoiding custom error messages. The solution involves replacing the current custom error messages with error.message from the storage module, as per your request.

For example, in the getSlackDetails function, I would change:

Before:

message: 'An unexpected error occurred'

To:

message: error.message

This pattern will be applied consistently across all relevant functions in the controllers link that you provide. If you approve, I can start making these changes.

Best regards, Oscar Arismendi

oscarArismendi avatar Sep 10 '24 18:09 oscarArismendi

Hi @oscarArismendi ,

Please go a head! Thanks for contributing.

venki91 avatar Sep 11 '24 09:09 venki91