feat(plugin): add v2 effect host (#33111)
This commit is contained in:
parent
7a9337da8a
commit
c780d7cee7
139 changed files with 3740 additions and 1943 deletions
|
|
@ -30,16 +30,13 @@ export const ProviderHandler = HttpApiBuilder.group(Api, "server.provider", (han
|
|||
const catalog = yield* Catalog.Service
|
||||
const pluginBoot = yield* PluginBoot.Service
|
||||
yield* pluginBoot.wait().pipe(Effect.catchDefect(() => Effect.fail(catalogUnavailable)))
|
||||
return yield* response(catalog.provider.get(ctx.params.providerID)).pipe(
|
||||
Effect.catchTag("CatalogV2.ProviderNotFound", (error) =>
|
||||
Effect.fail(
|
||||
new ProviderNotFoundError({
|
||||
providerID: error.providerID,
|
||||
message: `Provider not found: ${error.providerID}`,
|
||||
}),
|
||||
),
|
||||
),
|
||||
)
|
||||
const provider = yield* catalog.provider.get(ctx.params.providerID)
|
||||
if (!provider)
|
||||
return yield* new ProviderNotFoundError({
|
||||
providerID: ctx.params.providerID,
|
||||
message: `Provider not found: ${ctx.params.providerID}`,
|
||||
})
|
||||
return yield* response(Effect.succeed(provider))
|
||||
}),
|
||||
)
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue