Updating error management
Created by: nicosang
Hi,
as explained on the slack dashjs channel, I Think an important work has to be done on error management. In my opinion, it's important to
- centralize all the error codes and messages in a constant file.
- have an integer code to represent only one specific error code (for instance : 1 => MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE)
- send only one specific error when a problem occurs.
If everybody is agree with thoses modifications, I will propose an other PR to implement it on all error cases. An other task to do, according to me, will be to standardize error parameters in ErrorHandler to have : {error: 'errorName', event: {code: errorCode, message: errorMessage, data: errorObject}}
Nicolas