@countriesdb/widget-core 1.0.1 → 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/dist/api-client.js +8 -1
- package/dist/esm/api-client.js +8 -1
- package/package.json +1 -1
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",
|