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

Code before:
/**
 * @docs
 * @description
 * An unknown error occurred while reading or writing files to disk. It can be caused by many things, eg. missing permissions or a file not existing we attempt to read.
 */
export const UnknownFilesystemError = {
	name: 'UnknownFilesystemError',
	title: 'An unknown error occurred while reading or writing files to disk.',
	hint: 'It can be caused by many things, eg. missing permissions or a file not existing we attempt to read. Check the error cause for more details.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Cannot extract the font type from the given URL.
 */
export const CannotExtractFontType = {
	name: 'CannotExtractFontType',
	title: 'Cannot extract the font type from the given URL.',
	hint: 'Open an issue at https://github.com/withastro/astro/issues',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Cannot fetch the given font file
 * @message
 * An error occured while fetching font file from the given URL.
 */
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

Review comment (refactor):
```suggestion
 * Cannot extract the given font type
```
Bearing in mind that I don't know how the internals work... 😄 (And that these are placeholders!)

Just noting that the error seems to be named like it's a problem *extracting* the font type from a file (that it has fetched?), whereas this description says it couldn't fetch the file. It seems like each of these might put a different idea in someone's head as to what the problem is. (Is there a typo in the URL to the file, or is there a problem with the file itself?)

Maybe keeping consistent with "extracting the font type" is more helpful here, if that's what's happening? And there's literally error message about not being able to fetch the file already?


Code after:
/**
 * @docs
 * @description
 * An unknown error occurred while reading or writing files to disk. It can be caused by many things, eg. missing permissions or a file not existing we attempt to read.
 */
export const UnknownFilesystemError = {
	name: 'UnknownFilesystemError',
	title: 'An unknown error occurred while reading or writing files to disk.',
	hint: 'It can be caused by many things, eg. missing permissions or a file not existing we attempt to read. Check the error cause for more details.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Cannot extract the font type from the given URL.
 */
export const CannotExtractFontType = {
	name: 'CannotExtractFontType',
	title: 'Cannot extract the font type from the given URL.',
	hint: 'Open an issue at https://github.com/withastro/astro/issues.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Cannot fetch the given font file
 * @message
 * An error occured while fetching font file from the given URL.
 */
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