src/constants.js defines a mapping between error codes and a text message for what they represent.
Almost every subscription has at least two error codes, one for when the subscription already exists, and the other for when attempting to unsubscribe from a non-existent subscription.
This PR adds these error codes in the midGroups list, so it's possible for other libraries to know which mid group an error code corresponds to.
Additionally, error handling is added to prevent un/subscribing to mids that do not support that.
src/constants.js defines a mapping between error codes and a text message for what they represent.
Almost every subscription has at least two error codes, one for when the subscription already exists, and the other for when attempting to unsubscribe from a non-existent subscription.
This PR adds these error codes in the
midGroups
list, so it's possible for other libraries to know which mid group an error code corresponds to.Additionally, error handling is added to prevent un/subscribing to mids that do not support that.