فهرست منبع

fix: improve error handling in useSWRxLsx by throwing complete error response

Shun Miyazawa 7 ماه پیش
والد
کامیت
66d9396894
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      packages/remark-lsx/src/client/stores/lsx/lsx.ts

+ 2 - 2
packages/remark-lsx/src/client/stores/lsx/lsx.ts

@@ -77,9 +77,9 @@ export const useSWRxLsx = (
         return res.data;
         return res.data;
       } catch (err) {
       } catch (err) {
         if (axios.isAxiosError(err)) {
         if (axios.isAxiosError(err)) {
-          throw new Error(err.response?.data.message);
+          throw new Error(err.response?.data);
         }
         }
-        throw err;
+        throw new Error(err);
       }
       }
     },
     },