Repository: withastro/astro
File: packages/astro/src/core/errors/errors-data.ts (TypeScript)

Code before:
	message: (component: string) =>
		`Static pages aren't yet supported with multiple domains. To enable this feature, you must disable prerendering for the page ${component}`,
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro throws an error if the user enables manual routing, but it doesn't have a middleware file.
 */
export const MissingMiddlewareForInternationalization = {
	name: 'MissingMiddlewareForInternationalization',
	title: 'Enabled manual internationalization routing without having a middleware.',
	message:
		"Your configuration setting `i18n.routing: 'manual'` requires you to provide your own i18n `middleware` file.",
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro throws an error if the user passes an invalid configuration to the i18n middleware.
 */
export const InvalidI18nMiddlewareConfiguration = {
	name: 'InvalidI18nMiddlewareConfiguration',
	title: 'Invalid internationalization middleware configuration',
	message:
		'The option `redirectToDefaultLocale` can be enabled only when `prefixDefaultLocale` is set to `true`, otherwise redirects might cause infinite loops. Enable the option `prefixDefaultLocale`, or change its value to `false`.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro could not find an associated file with content while trying to render the route. This is an Astro error and not a user error. If restarting the dev server does not fix the problem, please file an issue.
 */
export const CantRenderPage = {
	name: 'CantRenderPage',
	title: "Astro can't render the route.",
	message:
		'Astro cannot find any content to render for this route. There is no file or redirect associated with this route.',
	hint: 'If you expect to find a route here, this may be an Astro bug. Please file an issue/restart the dev server',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro could not find any code to handle a rejected `Promise`. Make sure all your promises have an `await` or `.catch()` handler.
 */
export const UnhandledRejection = {
	name: 'UnhandledRejection',
	title: 'Unhandled rejection',
	message: (stack: string) =>
		`Astro detected an unhandled rejection. Here's the stack trace:\n${stack}`,

Review comment (bug):
```suggestion
		'The option `redirectToDefaultLocale` can be enabled only when `prefixDefaultLocale` is also set to `true`, otherwise redirects might cause infinite loops. Enable the option `prefixDefaultLocale` to continue to use `redirectToDefaultLocale`, or ensure neither are set.',
```
There are a few ways we could go here! It seems like it would make it easy to understand if we talk about both true, or both false (the only legal pairings happen to be where these setting values match?)? And, it seems like in v6 they will both default to `false`? 

(I originally had "or ensure both are set to `false`" but if they are both false by default, I think it probably seems simpler just to say not to set them? You'd never actually need to set them to false?

Code after:
	message: (component: string) =>
		`Static pages aren't yet supported with multiple domains. To enable this feature, you must disable prerendering for the page ${component}`,
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro throws an error if the user enables manual routing, but it doesn't have a middleware file.
 */
export const MissingMiddlewareForInternationalization = {
	name: 'MissingMiddlewareForInternationalization',
	title: 'Enabled manual internationalization routing without having a middleware.',
	message:
		"Your configuration setting `i18n.routing: 'manual'` requires you to provide your own i18n `middleware` file.",
} satisfies ErrorData;

/**
 * @docs
 * @description
 * An invalid i18n middleware configuration  was detected.
 */
export const InvalidI18nMiddlewareConfiguration = {
	name: 'InvalidI18nMiddlewareConfiguration',
	title: 'Invalid internationalization middleware configuration',
	message:
		'The option `redirectToDefaultLocale` can be enabled only when `prefixDefaultLocale` is also set to `true`, otherwise redirects might cause infinite loops. Enable the option `prefixDefaultLocale` to continue to use `redirectToDefaultLocale`, or ensure both are set to `false`.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro could not find an associated file with content while trying to render the route. This is an Astro error and not a user error. If restarting the dev server does not fix the problem, please file an issue.
 */
export const CantRenderPage = {
	name: 'CantRenderPage',
	title: "Astro can't render the route.",
	message:
		'Astro cannot find any content to render for this route. There is no file or redirect associated with this route.',
	hint: 'If you expect to find a route here, this may be an Astro bug. Please file an issue/restart the dev server',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro could not find any code to handle a rejected `Promise`. Make sure all your promises have an `await` or `.catch()` handler.
 */
export const UnhandledRejection = {
	name: 'UnhandledRejection',
	title: 'Unhandled rejection',
	message: (stack: string) =>
		`Astro detected an unhandled rejection. Here's the stack trace:\n${stack}`,