mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-23 12:54:42 +00:00
fix: add error msg if well known config url cannot be fetched
This commit is contained in:
parent
1717d636a2
commit
b417e1eb9d
1 changed files with 1 additions and 1 deletions
|
|
@ -498,7 +498,7 @@ export const layer = Layer.effect(
|
|||
const url = key.replace(/\/+$/, "")
|
||||
process.env[value.key] = value.token
|
||||
log.debug("fetching remote config", { url: `${url}/.well-known/opencode` })
|
||||
const response = yield* Effect.promise(() => fetch(`${url}/.well-known/opencode`))
|
||||
const response = yield* Effect.tryPromise(() => fetch(`${url}/.well-known/opencode`)).pipe(Effect.mapError((cause) => new Error(`failed to fetch remote config from wellknown provider ${url}: ${cause}`)))
|
||||
if (!response.ok) {
|
||||
throw new Error(`failed to fetch remote config from ${url}: ${response.status}`)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue