We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
parseProviders()
providerId
1 parent 7f2c94f commit 80a2c14Copy full SHA for 80a2c14
1 file changed
packages/core/src/lib/utils/providers.ts
@@ -62,10 +62,15 @@ export default function parseProviders(params: {
62
return merged as InternalProvider
63
})
64
65
- return {
66
- providers,
67
- provider: providers.find(({ id }) => id === providerId),
+ const provider = providers.find(({ id }) => id === providerId)
+ if (providerId && !provider) {
+ const availableProviders = providers.map((p) => p.id).join(", ")
68
+ throw new Error(
69
+ `Provider with id "${providerId}" not found. Available providers: [${availableProviders}].`
70
+ )
71
}
72
+
73
+ return { providers, provider }
74
75
76
// TODO: Also add discovery here, if some endpoints/config are missing.
0 commit comments