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

Code before:
 */
export const CannotFetchFontFile = {
	name: 'CannotFetchFontFile',
	title: 'Cannot fetch the given font file.',
	message: (url: string) => `An error occured while fetching font file from ${url}`,
	hint: 'Check the error cause and open an issue if it cannot be solved on your side.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * A local font file referenced in your Astro config has been deleted. Restore the file or update your Astro config.
 */
export const DeletedLocalFont = {
	name: 'DeletedLocalFont',
	title: 'A local font has been deleted',
	message: 'A local font file referenced in your config has been deleted.',
	hint: 'Restore the file or update your config.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Cannot load font provider
 * @message
 * An error occured while loading the given provider. Open an issue on the corresponding repository.
 */
export const CannotLoadFontProvider = {
	name: 'CannotLoadFontProvider',
	title: 'Cannot load font provider',
	message: (provider: string) => `An error occured while loading the "${provider}" provider.`,
	hint: 'Open an issue on the corresponding repository.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Font component is used but experimental fonts have not been registered in the config.
 */
export const ExperimentalFontsNotEnabled = {
	name: 'ExperimentalFontsNotEnabled',
	title: 'Experimental fonts are not enabled',
	message:
		'Font component is used but experimental fonts have not been registered in the config.',
	hint: 'See TODO:',
} satisfies ErrorData;

export const FontFamilyNotFound = {
	name: 'FontFamilyNotFound',
	title: 'Font family not found',
	message: (family: string) => `No data was found for the "${family}" family.`,

Review comment (suggestion):
```suggestion
 * Astro is unable to load the given font provider. Open an issue on the corresponding provider's repository.
```
I think here, more than just "an error occurred" we might want to more strongly imply "Astro knows what it's doing, but it can't make sense of what it was given." Otherwise, it's hard to know that this isn't an Astro error.

Code after:
 */
export const CannotFetchFontFile = {
	name: 'CannotFetchFontFile',
	title: 'Cannot fetch the given font file.',
	message: (url: string) => `An error occurred while fetching the font file from ${url}`,
	hint: 'This is often caused by connectivity issues. If the error persists, open an issue at https://github.com/withastro/astro/issues.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * A local font file referenced in your Astro config has been deleted. Restore the file or update your Astro config.
 */
export const DeletedLocalFont = {
	name: 'DeletedLocalFont',
	title: 'A local font has been deleted',
	message: 'A local font file referenced in your config has been deleted.',
	hint: 'Restore the file or remove this font from your configuration if it is no longer needed.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Cannot load font provider
 * @message
 * Astro is unable to load the given font provider. Open an issue on the corresponding provider's repository.
 */
export const CannotLoadFontProvider = {
	name: 'CannotLoadFontProvider',
	title: 'Cannot load font provider',
	message: (provider: string) => `An error occured while loading the "${provider}" provider.`,
	hint: 'This is an issue with the font provider. Please open an issue on their repository.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Font component is used but experimental fonts have not been registered in the config.
 */
export const ExperimentalFontsNotEnabled = {
	name: 'ExperimentalFontsNotEnabled',
	title: 'Experimental fonts are not enabled',
	message:
		'The Font component is used but experimental fonts have not been registered in the config.',
	hint: 'See TODO:',
} satisfies ErrorData;

export const FontFamilyNotFound = {
	name: 'FontFamilyNotFound',
	title: 'Font family not found',
	message: (family: string) => `No data was found for the "${family}" family.`,