MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / toPublishError

Function toPublishError

packages/plugins/apps/src/pipeline/publish.ts:104–121  ·  view source on GitHub ↗
(
  stage: PublishError["stage"],
  path: string,
  cause: {
    readonly message: string;
    readonly diagnostics?: readonly { readonly path: string; readonly message: string }[];
  },
)

Source from the content-addressed store, hash-verified

102const decodeJson = Schema.decodeUnknownSync(Schema.UnknownFromJsonString);
103
104const toPublishError = (
105 stage: PublishError["stage"],
106 path: string,
107 cause: {
108 readonly message: string;
109 readonly diagnostics?: readonly { readonly path: string; readonly message: string }[];
110 },
111): PublishError =>
112 new PublishError({
113 stage,
114 // oxlint-disable-next-line executor/no-unknown-error-message -- typed AppExecutorError conversion keeps its stable diagnostic message
115 message: cause.message,
116 diagnostics:
117 cause.diagnostics && cause.diagnostics.length > 0
118 ? cause.diagnostics
119 : // oxlint-disable-next-line executor/no-unknown-error-message -- typed AppExecutorError conversion keeps its stable diagnostic message
120 [{ path, message: cause.message }],
121 });
122
123const toolDescriptor = (input: {
124 readonly collected: CollectedTool;

Callers 1

publishFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected