Rocky_Mountain_Vending/.pnpm-store/v10/files/0b/93ffbc3d00d33981d98b7623647c2297035f7ef150da4427e2592dd5ee0c56f02ef6e50b19bd9d2d94a7231e404294ce2f79440cf9039445dd232a0755c06e
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

38 lines
No EOL
1.6 KiB
Text

import { isPlainObject } from '../shared/lib/is-plain-object';
import safeStringify from 'next/dist/compiled/safe-stable-stringify';
/**
* Checks whether the given value is a NextError.
* This can be used to print a more detailed error message with properties like `code` & `digest`.
*/ export default function isError(err) {
return typeof err === 'object' && err !== null && 'name' in err && 'message' in err;
}
export function getProperError(err) {
if (isError(err)) {
return err;
}
if (process.env.NODE_ENV === 'development') {
// provide better error for case where `throw undefined`
// is called in development
if (typeof err === 'undefined') {
return Object.defineProperty(new Error('An undefined error was thrown, ' + 'see here for more info: https://nextjs.org/docs/messages/threw-undefined'), "__NEXT_ERROR_CODE", {
value: "E98",
enumerable: false,
configurable: true
});
}
if (err === null) {
return Object.defineProperty(new Error('A null error was thrown, ' + 'see here for more info: https://nextjs.org/docs/messages/threw-undefined'), "__NEXT_ERROR_CODE", {
value: "E336",
enumerable: false,
configurable: true
});
}
}
return Object.defineProperty(new Error(isPlainObject(err) ? safeStringify(err) : err + ''), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
}
//# sourceMappingURL=is-error.js.map