@countriesdb/widget-core 1.0.0 → 1.0.2
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/README.md +1 -1
- package/dist/api-client.js +8 -1
- package/dist/esm/api-client.js +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ This package is automatically installed as a dependency of other CountriesDB pac
|
|
|
32
32
|
|
|
33
33
|
## License
|
|
34
34
|
|
|
35
|
-
PROPRIETARY - Copyright (c) NAYEE LLC.
|
|
35
|
+
PROPRIETARY - Copyright (c) NAYEE LLC. This package is published publicly on npm but is intended for internal use by other CountriesDB packages only.
|
|
36
36
|
|
|
37
37
|
**Developed by [NAYEE LLC](https://nayee.net)**
|
|
38
38
|
|
package/dist/api-client.js
CHANGED
|
@@ -62,7 +62,14 @@ class CountriesDBClient {
|
|
|
62
62
|
let errorMessage = `HTTP Error: ${response.status}`;
|
|
63
63
|
try {
|
|
64
64
|
const errorData = await response.json();
|
|
65
|
-
|
|
65
|
+
// Check for error message in various formats (ApplicationException uses 'detail', others may use 'error' or 'message')
|
|
66
|
+
if (errorData.detail) {
|
|
67
|
+
errorMessage = errorData.detail;
|
|
68
|
+
}
|
|
69
|
+
else if (errorData.message) {
|
|
70
|
+
errorMessage = errorData.message;
|
|
71
|
+
}
|
|
72
|
+
else if (errorData.error) {
|
|
66
73
|
errorMessage = errorData.error;
|
|
67
74
|
}
|
|
68
75
|
}
|
package/dist/esm/api-client.js
CHANGED
|
@@ -59,7 +59,14 @@ export class CountriesDBClient {
|
|
|
59
59
|
let errorMessage = `HTTP Error: ${response.status}`;
|
|
60
60
|
try {
|
|
61
61
|
const errorData = await response.json();
|
|
62
|
-
|
|
62
|
+
// Check for error message in various formats (ApplicationException uses 'detail', others may use 'error' or 'message')
|
|
63
|
+
if (errorData.detail) {
|
|
64
|
+
errorMessage = errorData.detail;
|
|
65
|
+
}
|
|
66
|
+
else if (errorData.message) {
|
|
67
|
+
errorMessage = errorData.message;
|
|
68
|
+
}
|
|
69
|
+
else if (errorData.error) {
|
|
63
70
|
errorMessage = errorData.error;
|
|
64
71
|
}
|
|
65
72
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@countriesdb/widget-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Internal package - Core TypeScript API client and utilities for CountriesDB widget and validation libraries. Not intended for direct use.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|