You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes we need to find out which error was thrown. To avoid a break of our application when we change the string of the error message, we should use constants that we use for throwing an error and that can be used by a developper for checking it like
const STATUS_NOT_VALID = "Status is not valid";
...
throw new Error(STATUS_NOT_VALID)
...
catch(e) {
if(e.message === STATUS_NOT_VALID)
}
The text was updated successfully, but these errors were encountered:
Sometimes we need to find out which error was thrown. To avoid a break of our application when we change the string of the error message, we should use constants that we use for throwing an error and that can be used by a developper for checking it like
The text was updated successfully, but these errors were encountered: