basyx-typescript-sdk 2.3.0 → 2.3.1
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/bundle/index.cjs +9 -2
- package/bundle/index.cjs.map +1 -1
- package/bundle/index.mjs +9 -2
- package/bundle/index.mjs.map +1 -1
- package/dist/lib/errorHandler.js +9 -4
- package/package.json +1 -1
package/bundle/index.cjs
CHANGED
|
@@ -25973,6 +25973,13 @@ function isRequiredErrorLike(err) {
|
|
|
25973
25973
|
return err instanceof RequiredError || err?.name === "RequiredError";
|
|
25974
25974
|
}
|
|
25975
25975
|
/**
|
|
25976
|
+
* Returns the current time as a UTC date-time string matching the timestamp
|
|
25977
|
+
* pattern of the AAS API Message schema.
|
|
25978
|
+
*/
|
|
25979
|
+
function currentTimestamp() {
|
|
25980
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
25981
|
+
}
|
|
25982
|
+
/**
|
|
25976
25983
|
* Processes errors from API calls and standardizes them to a Result object
|
|
25977
25984
|
* with a consistent messages array following the API spec guidelines.
|
|
25978
25985
|
*
|
|
@@ -25983,7 +25990,7 @@ async function handleApiError(err) {
|
|
|
25983
25990
|
try {
|
|
25984
25991
|
const errorAny = err;
|
|
25985
25992
|
if (errorAny?.messages && Array.isArray(errorAny.messages)) return { messages: errorAny.messages };
|
|
25986
|
-
const timestamp = (
|
|
25993
|
+
const timestamp = currentTimestamp();
|
|
25987
25994
|
let message = {
|
|
25988
25995
|
code: "500",
|
|
25989
25996
|
messageType: "Exception",
|
|
@@ -26034,7 +26041,7 @@ async function handleApiError(err) {
|
|
|
26034
26041
|
code: "500",
|
|
26035
26042
|
messageType: "Exception",
|
|
26036
26043
|
text: "An error occurred while processing another error",
|
|
26037
|
-
timestamp: (
|
|
26044
|
+
timestamp: currentTimestamp()
|
|
26038
26045
|
}] };
|
|
26039
26046
|
}
|
|
26040
26047
|
}
|