@koda-sl/baker-cli 0.136.0 → 0.136.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.
@@ -983,6 +983,42 @@ var LayerExecutionError = class extends CanvasError {
983
983
  function describeFailureReason(reason) {
984
984
  return reason instanceof Error ? reason.message : String(reason);
985
985
  }
986
+ function failureDetail(reason) {
987
+ if (reason instanceof NodeExecutionError) {
988
+ const c = reason.cause;
989
+ switch (c.kind) {
990
+ case "remote":
991
+ return {
992
+ message: c.message,
993
+ code: c.code,
994
+ provider: c.provider,
995
+ retryable: c.retryable ?? (c.status >= 500 || c.status === 429)
996
+ };
997
+ case "timeout":
998
+ return {
999
+ message: `timed out${c.provider ? ` (${c.provider})` : ""}`,
1000
+ code: "timeout",
1001
+ provider: c.provider,
1002
+ retryable: true
1003
+ };
1004
+ case "content_policy":
1005
+ return { message: c.message, code: "content_policy", provider: c.provider, retryable: false };
1006
+ case "network":
1007
+ return {
1008
+ message: c.cause instanceof Error ? c.cause.message : "network error",
1009
+ code: "network",
1010
+ retryable: true
1011
+ };
1012
+ case "local":
1013
+ return { message: c.cause instanceof Error ? c.cause.message : String(c.cause), code: "local" };
1014
+ default: {
1015
+ const _exhaustive = c;
1016
+ return { message: String(_exhaustive) };
1017
+ }
1018
+ }
1019
+ }
1020
+ return { message: describeFailureReason(reason) };
1021
+ }
986
1022
  function describeCause(c) {
987
1023
  switch (c.kind) {
988
1024
  case "local":
@@ -3936,7 +3972,7 @@ var Engine = class {
3936
3972
  if (result.status === "rejected" && nodeId) {
3937
3973
  if (result.reason instanceof RunAbortedError) return;
3938
3974
  failures.push({ nodeId, reason: result.reason });
3939
- this.emitProgress(opts, { kind: "node_failed", node_id: nodeId });
3975
+ this.emitProgress(opts, { kind: "node_failed", node_id: nodeId, error: failureDetail(result.reason) });
3940
3976
  }
3941
3977
  });
3942
3978
  if (opts.signal?.aborted) throw new RunAbortedError("signal", "run aborted by signal");
@@ -4512,7 +4548,10 @@ function mapClientError(ctx, e) {
4512
4548
  status: d.status,
4513
4549
  code: d.code,
4514
4550
  message: d.message,
4515
- provider: d.provider
4551
+ provider: d.provider,
4552
+ // The backend's real classification — providerErr pins the status to 502,
4553
+ // so this flag (not the status) is the source of truth for retryability.
4554
+ retryable: d.retryable
4516
4555
  });
4517
4556
  }
4518
4557
  if (d.kind === "content_policy") {
@@ -7798,4 +7837,4 @@ export {
7798
7837
  defaultRegistry,
7799
7838
  createEngineFromEnv
7800
7839
  };
7801
- //# sourceMappingURL=chunk-CIF62V7L.js.map
7840
+ //# sourceMappingURL=chunk-TAGQCU36.js.map