fix: check the error type and return as string
This commit is contained in:
@@ -175,7 +175,7 @@ export const extractErrorMessage = (result: any) => {
|
|||||||
result?.error?.message ||
|
result?.error?.message ||
|
||||||
result?.data;
|
result?.data;
|
||||||
if (errorMsg) {
|
if (errorMsg) {
|
||||||
return errorMsg;
|
return typeof errorMsg === 'string' ? errorMsg : JSON.stringify(errorMsg);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return typeof result === 'string' ? result : JSON.stringify(result);
|
return typeof result === 'string' ? result : JSON.stringify(result);
|
||||||
|
|||||||
Reference in New Issue
Block a user