refactor(provider): type init errors (#27484)

This commit is contained in:
Shoubhit Dash
2026-05-14 14:48:58 +05:30
committed by GitHub
parent 0af242974c
commit be6e7b309e
3 changed files with 22 additions and 9 deletions

View File

@@ -72,8 +72,9 @@ export function FormatError(input: unknown) {
}
// ProviderInitError: { providerID: string }
if (NamedError.hasName(input, "ProviderInitError")) {
return `Failed to initialize provider "${(input as ErrorLike).data?.providerID}". Check credentials and configuration.`
const providerInit = configData(input, "ProviderInitError")
if (providerInit) {
return `Failed to initialize provider "${stringField(providerInit, "providerID")}". Check credentials and configuration.`
}
// ConfigJsonError: { path: string, message?: string }