@skillrecordings/cli 0.18.0 → 0.18.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.
@@ -6,6 +6,24 @@ import {
6
6
  init_esm_shims();
7
7
  import { Axiom } from "@axiomhq/js";
8
8
  var axiomClient = null;
9
+ var hasLoggedTransientAxiomIngestWarning = false;
10
+ function isTransientAxiomIngestError(error) {
11
+ if (!(error instanceof Error)) return false;
12
+ const message = error.message || "";
13
+ return error instanceof SyntaxError && message.includes("Unexpected end of JSON input") || error.name === "TimeoutError" || message.includes("The operation timed out");
14
+ }
15
+ function handleAxiomError(error, context) {
16
+ if (isTransientAxiomIngestError(error)) {
17
+ if (!hasLoggedTransientAxiomIngestWarning) {
18
+ hasLoggedTransientAxiomIngestWarning = true;
19
+ console.warn(
20
+ "[Axiom] Transient ingest response issue detected; suppressing repeated warnings"
21
+ );
22
+ }
23
+ return;
24
+ }
25
+ console.error(`[Axiom] Failed to ${context}:`, error);
26
+ }
9
27
  async function sendTrace(trace) {
10
28
  if (!axiomClient) {
11
29
  return;
@@ -17,7 +35,7 @@ async function sendTrace(trace) {
17
35
  ...trace
18
36
  });
19
37
  } catch (error) {
20
- console.error("[Axiom] Failed to send trace:", error);
38
+ handleAxiomError(error, "send trace");
21
39
  }
22
40
  }
23
41
  async function log(level, message, metadata) {
@@ -4492,4 +4510,4 @@ export {
4492
4510
  traceMemoryCite,
4493
4511
  Redis2
4494
4512
  };
4495
- //# sourceMappingURL=chunk-KEV3QKXP.js.map
4513
+ //# sourceMappingURL=chunk-HKRLO2GE.js.map