dymo-api 1.0.88 → 1.0.90
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.
|
@@ -75,7 +75,10 @@ const isValidData = async (token, data) => {
|
|
|
75
75
|
return response.data;
|
|
76
76
|
}
|
|
77
77
|
catch (error) {
|
|
78
|
-
|
|
78
|
+
const statusCode = error.response?.status || 500;
|
|
79
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
80
|
+
const errorDetails = JSON.stringify(error.response?.data || {});
|
|
81
|
+
throw customError(5000, `Error ${statusCode}: ${errorMessage}. Details: ${errorDetails}`);
|
|
79
82
|
}
|
|
80
83
|
};
|
|
81
84
|
exports.isValidData = isValidData;
|
|
@@ -36,7 +36,10 @@ export const isValidData = async (token, data) => {
|
|
|
36
36
|
return response.data;
|
|
37
37
|
}
|
|
38
38
|
catch (error) {
|
|
39
|
-
|
|
39
|
+
const statusCode = error.response?.status || 500;
|
|
40
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
41
|
+
const errorDetails = JSON.stringify(error.response?.data || {});
|
|
42
|
+
throw customError(5000, `Error ${statusCode}: ${errorMessage}. Details: ${errorDetails}`);
|
|
40
43
|
}
|
|
41
44
|
};
|
|
42
45
|
/**
|