Rocky_Mountain_Vending/.pnpm-store/v10/files/77/843e7822fb87919cf75c870682967ef19ab551a3c2188a02708fe042183e0a5df1fa78def6c0db1cbbb81375fbf8fdb6babb68b5ed9898d30cc62c7d1fef6a
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

21 lines
579 B
Text

import { ProviderError } from "./ProviderError";
export const chain = (...providers) => async () => {
if (providers.length === 0) {
throw new ProviderError("No providers in chain");
}
let lastProviderError;
for (const provider of providers) {
try {
const credentials = await provider();
return credentials;
}
catch (err) {
lastProviderError = err;
if (err?.tryNextLink) {
continue;
}
throw err;
}
}
throw lastProviderError;
};