Is there a possibility how to overwrite those temporary error messages that are displayed when an error occured? For example, when there is an error with 500
status, the front-end
displays an error: Internal Server Error
. I would like to check if the error has a status of 500 and then to overwrite the message to something more specific.
So far I have tried to put this code into my AuthProvider.js
but it does not seem to work for me.
if (type === AUTH_ERROR) {
const status = params.status;
if (status === 500) {
throw new Error('ErrorMessage');
}
return Promise.resolve();
}
I checked the value of status
and it is 500. but the message stays the same.
Any ideas how to solve this?
Thank you in advance.