heartbeat-monitor/node_modules/next/dist/esm/client/components/unstable-rethrow.js
Matt Bruce bed1169443 Initial commit: Heartbeat Monitor dashboard
- Full-featured monitoring dashboard for local web apps
- Real-time status tracking with uptime percentages
- Visual sparklines for status history
- Add/Edit/Delete apps dynamically
- Categories and color coding
- Auto-refresh every 30 seconds
- API endpoints for apps and status management
2026-02-18 11:16:01 -06:00

20 lines
1.1 KiB
JavaScript

import { isDynamicUsageError } from '../../export/helpers/is-dynamic-usage-error';
import { isPostpone } from '../../server/lib/router-utils/is-postpone';
import { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr';
import { isNextRouterError } from './is-next-router-error';
/**
* This function should be used to rethrow internal Next.js errors so that they can be handled by the framework.
* When wrapping an API that uses errors to interrupt control flow, you should use this function before you do any error handling.
* This function will rethrow the error if it is a Next.js error so it can be handled, otherwise it will do nothing.
*
* Read more: [Next.js Docs: `unstable_rethrow`](https://nextjs.org/docs/app/api-reference/functions/unstable_rethrow)
*/ export function unstable_rethrow(error) {
if (isNextRouterError(error) || isBailoutToCSRError(error) || isDynamicUsageError(error) || isPostpone(error)) {
throw error;
}
if (error instanceof Error && 'cause' in error) {
unstable_rethrow(error.cause);
}
}
//# sourceMappingURL=unstable-rethrow.js.map