@signaliz/sdk 1.0.36 → 1.0.37
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.
|
@@ -22,16 +22,19 @@ function parseError(status, body) {
|
|
|
22
22
|
details: body.error.details
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
const code = typeof body?.error_code === "string" && body.error_code.trim() ? body.error_code.trim() : `HTTP_${status}`;
|
|
25
26
|
return new SignalizError({
|
|
26
|
-
code
|
|
27
|
+
code,
|
|
27
28
|
message: body?.message || body?.error || `Request failed with status ${status}`,
|
|
28
|
-
errorType: mapErrorType(
|
|
29
|
+
errorType: mapErrorType(code, status),
|
|
30
|
+
details: body?.details || (body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : void 0)
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
33
|
function mapErrorType(code, status) {
|
|
32
34
|
if (code === "RATE_LIMITED" || status === 429) return "rate_limited";
|
|
33
35
|
if (code === "VALIDATION_ERROR" || status === 400) return "validation";
|
|
34
36
|
if (code === "NOT_FOUND" || status === 404) return "not_found";
|
|
37
|
+
if (code === "NO_SUPPORTED_SIGNAL") return "not_found";
|
|
35
38
|
if (code === "AUTH_EXPIRED" || status === 401) return "auth_expired";
|
|
36
39
|
if (code === "INSUFFICIENT_CREDITS" || status === 402) return "insufficient_credits";
|
|
37
40
|
if (code === "TIMEOUT" || status === 504) return "timeout";
|
package/dist/index.js
CHANGED
|
@@ -49,16 +49,19 @@ function parseError(status, body) {
|
|
|
49
49
|
details: body.error.details
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
+
const code = typeof body?.error_code === "string" && body.error_code.trim() ? body.error_code.trim() : `HTTP_${status}`;
|
|
52
53
|
return new SignalizError({
|
|
53
|
-
code
|
|
54
|
+
code,
|
|
54
55
|
message: body?.message || body?.error || `Request failed with status ${status}`,
|
|
55
|
-
errorType: mapErrorType(
|
|
56
|
+
errorType: mapErrorType(code, status),
|
|
57
|
+
details: body?.details || (body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : void 0)
|
|
56
58
|
});
|
|
57
59
|
}
|
|
58
60
|
function mapErrorType(code, status) {
|
|
59
61
|
if (code === "RATE_LIMITED" || status === 429) return "rate_limited";
|
|
60
62
|
if (code === "VALIDATION_ERROR" || status === 400) return "validation";
|
|
61
63
|
if (code === "NOT_FOUND" || status === 404) return "not_found";
|
|
64
|
+
if (code === "NO_SUPPORTED_SIGNAL") return "not_found";
|
|
62
65
|
if (code === "AUTH_EXPIRED" || status === 401) return "auth_expired";
|
|
63
66
|
if (code === "INSUFFICIENT_CREDITS" || status === 402) return "insufficient_credits";
|
|
64
67
|
if (code === "TIMEOUT" || status === 504) return "timeout";
|
package/dist/index.mjs
CHANGED
package/dist/mcp-config.js
CHANGED
|
@@ -53,16 +53,19 @@ function parseError(status, body) {
|
|
|
53
53
|
details: body.error.details
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
+
const code = typeof body?.error_code === "string" && body.error_code.trim() ? body.error_code.trim() : `HTTP_${status}`;
|
|
56
57
|
return new SignalizError({
|
|
57
|
-
code
|
|
58
|
+
code,
|
|
58
59
|
message: body?.message || body?.error || `Request failed with status ${status}`,
|
|
59
|
-
errorType: mapErrorType(
|
|
60
|
+
errorType: mapErrorType(code, status),
|
|
61
|
+
details: body?.details || (body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : void 0)
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
function mapErrorType(code, status) {
|
|
63
65
|
if (code === "RATE_LIMITED" || status === 429) return "rate_limited";
|
|
64
66
|
if (code === "VALIDATION_ERROR" || status === 400) return "validation";
|
|
65
67
|
if (code === "NOT_FOUND" || status === 404) return "not_found";
|
|
68
|
+
if (code === "NO_SUPPORTED_SIGNAL") return "not_found";
|
|
66
69
|
if (code === "AUTH_EXPIRED" || status === 401) return "auth_expired";
|
|
67
70
|
if (code === "INSUFFICIENT_CREDITS" || status === 402) return "insufficient_credits";
|
|
68
71
|
if (code === "TIMEOUT" || status === 504) return "timeout";
|
package/dist/mcp-config.mjs
CHANGED
package/package.json
CHANGED