@bzbs/react-api-client 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -56,9 +56,26 @@ var BaseService = class {
56
56
  };
57
57
  }
58
58
  if (error.response && error.response.data) {
59
+ const data = error.response.data;
60
+ if (data["Success"]) {
61
+ return {
62
+ type: "server-error",
63
+ error: {
64
+ requestId: data.RequestId || "",
65
+ error: {
66
+ id: data.Code || data.code || error.response.status,
67
+ message: data.Message || data.message || error.response.statusText,
68
+ code: data.Code || data.code || error.response.status,
69
+ type: "buzzebees"
70
+ }
71
+ },
72
+ statusCode: error.response.status,
73
+ response: error.response
74
+ };
75
+ }
59
76
  return {
60
77
  type: "server-error",
61
- error: error.response.data,
78
+ error: data,
62
79
  statusCode: error.response.status,
63
80
  response: error.response
64
81
  };