eleven-solutions-common-website-unique-web 21.0.34 → 21.0.35

Sign up to get free protection for your applications and to get access to all the features.
@@ -168,6 +168,7 @@ const TaxonomyForm = ({ url }) => {
168
168
  setIsAddingSubType(true);
169
169
  };
170
170
  const handleSubTypeSubmitClick = () => __awaiter(void 0, void 0, void 0, function* () {
171
+ var _a;
171
172
  if (!subCode || !subValue) {
172
173
  alert("Please fill out both Code and Value fields before proceeding.");
173
174
  return;
@@ -187,8 +188,16 @@ const TaxonomyForm = ({ url }) => {
187
188
  }
188
189
  }
189
190
  catch (error) {
190
- console.error(`Error ${editTaxonomyItem ? "editing" : "adding"} SubType:`, error);
191
- alert("Error while adding SubType: " + error.response.data.message);
191
+ // Extract additional details if available
192
+ const errorMessage = error.message || "An unknown error occurred";
193
+ const innerException = error.innerException || ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) || error.details || "";
194
+ // Combine the main message with additional details
195
+ const detailedMessage = innerException
196
+ ? `${errorMessage}\n\nDetails: ${JSON.stringify(innerException, null, 2)}`
197
+ : errorMessage;
198
+ // Display the detailed error message in an alert
199
+ alert("Error while adding SubType: " + detailedMessage);
200
+ console.error("Error details:", error); // Log full error for debugging
192
201
  }
193
202
  setIsModalOpen(false);
194
203
  setSubCode("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "21.0.34",
3
+ "version": "21.0.35",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -248,12 +248,25 @@ const TaxonomyForm = ({ url }: TaxionomyFormProps) => {
248
248
  if (fetchedTaxonomies && Array.isArray(fetchedTaxonomies)) {
249
249
  setAllTaxonomies(fetchedTaxonomies);
250
250
  }
251
- } catch (error) {
252
- console.error(
253
- `Error ${editTaxonomyItem ? "editing" : "adding"} SubType:`,
254
- error
255
- );
256
- alert("Error while adding SubType: " + error.response.data.message);
251
+ } catch (error: any) {
252
+ // Extract additional details if available
253
+ const errorMessage = error.message || "An unknown error occurred";
254
+ const innerException =
255
+ error.innerException || error.response?.data || error.details || "";
256
+
257
+ // Combine the main message with additional details
258
+ const detailedMessage = innerException
259
+ ? `${errorMessage}\n\nDetails: ${JSON.stringify(
260
+ innerException,
261
+ null,
262
+ 2
263
+ )}`
264
+ : errorMessage;
265
+
266
+ // Display the detailed error message in an alert
267
+ alert("Error while adding SubType: " + detailedMessage);
268
+
269
+ console.error("Error details:", error); // Log full error for debugging
257
270
  }
258
271
 
259
272
  setIsModalOpen(false);