MCPcopy Index your code
hub / github.com/anomalyco/opencode / error

Function error

packages/opencode/src/plugin/index.ts:189–211  ·  view source on GitHub ↗
(candidate, _retry, stage, error, resolved)

Source from the content-addressed store, hash-verified

187 start(candidate) {},
188 missing(candidate, _retry, message) {},
189 error(candidate, _retry, stage, error, resolved) {
190 const spec = candidate.plan.spec
191 const cause = error instanceof Error ? (error.cause ?? error) : error
192 const message = stage === "load" ? errorMessage(error) : errorMessage(cause)
193
194 if (stage === "install") {
195 const parsed = parsePluginSpecifier(spec)
196 publishPluginError(`Failed to install plugin ${parsed.pkg}@${parsed.version}: ${message}`)
197 return
198 }
199
200 if (stage === "compatibility") {
201 publishPluginError(`Plugin ${spec} skipped: ${message}`)
202 return
203 }
204
205 if (stage === "entry") {
206 publishPluginError(`Failed to load plugin ${spec}: ${message}`)
207 return
208 }
209
210 publishPluginError(`Failed to load plugin ${spec}: ${message}`)
211 },
212 },
213 }),
214 )

Callers

nothing calls this directly

Calls 3

errorMessageFunction · 0.90
parsePluginSpecifierFunction · 0.90
publishPluginErrorFunction · 0.85

Tested by

no test coverage detected