@bahmni/services 0.0.1-dev.60 → 0.0.1-dev.64
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/errorHandling/utils.d.ts.map +1 -1
- package/dist/index.js +11 -7
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/errorHandling/utils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,OAAO,KACb;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/errorHandling/utils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,OAAO,KACb;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAyElC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1752,18 +1752,22 @@ const {
|
|
|
1752
1752
|
getAdapter: wy,
|
|
1753
1753
|
mergeConfig: vy
|
|
1754
1754
|
} = le, ut = (e) => {
|
|
1755
|
+
var n;
|
|
1755
1756
|
let t = "Error", r = "An unexpected error occurred";
|
|
1756
1757
|
if (!e)
|
|
1757
1758
|
return { title: t, message: r };
|
|
1758
1759
|
if (typeof e == "string")
|
|
1759
1760
|
r = e;
|
|
1760
1761
|
else if (le.isAxiosError(e)) {
|
|
1761
|
-
const
|
|
1762
|
-
if (
|
|
1763
|
-
switch (
|
|
1764
|
-
case 400:
|
|
1765
|
-
t = "Bad Request"
|
|
1762
|
+
const a = e;
|
|
1763
|
+
if (a != null && a.response)
|
|
1764
|
+
switch (a.response.status) {
|
|
1765
|
+
case 400: {
|
|
1766
|
+
t = "Bad Request";
|
|
1767
|
+
const i = a.response.data;
|
|
1768
|
+
r = ((n = i == null ? void 0 : i.error) == null ? void 0 : n.message) ?? (i == null ? void 0 : i.message) ?? "Invalid input parameters. Please check your request and try again.";
|
|
1766
1769
|
break;
|
|
1770
|
+
}
|
|
1767
1771
|
case 401:
|
|
1768
1772
|
t = "Unauthorized", r = "You are not authorized to perform this action. Please log in again.";
|
|
1769
1773
|
break;
|
|
@@ -1781,8 +1785,8 @@ const {
|
|
|
1781
1785
|
break;
|
|
1782
1786
|
default: {
|
|
1783
1787
|
t = "Error";
|
|
1784
|
-
const
|
|
1785
|
-
r = (
|
|
1788
|
+
const i = a.response.data;
|
|
1789
|
+
r = (i == null ? void 0 : i.message) ?? a.message ?? "An unknown error occurred";
|
|
1786
1790
|
}
|
|
1787
1791
|
}
|
|
1788
1792
|
else e instanceof Error ? r = e.message : (t = "Network Error", r = "Unable to connect to the server. Please check your internet connection.");
|