Explorar el Código

[fix] report err msg

wenliming hace 2 años
padre
commit
d0415eabcd
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      src/http/fetch.js

+ 6 - 1
src/http/fetch.js

@@ -61,7 +61,12 @@ export async function commonFetch({ url = '', method = 'POST' , params = {}, bas
                 resolve(data);
             })
             .catch((error) => {
-                reject({url: _url, error: error, requestParams: bodyObj});
+                if(!error) {
+                    error = {}
+                }
+                reject({url: _url, 
+                        error: { message: error.message, stack: error.stack }, 
+                        requestParams: bodyObj });
             });
     })
 }