Merge remote-tracking branch 'origin/main' into mbg/refactor-util/errors

This commit is contained in:
Michael B. Gale
2026-10-30 16:50:30 +00:00
160 changed files with 18861 additions and 8747 deletions

View File

@@ -18,6 +18,21 @@ export function getErrorMessage(error: unknown): string {
return error instanceof Error ? error.message : String(error);
}
/**
* Approximates whether {@link error} is like a {@link NodeJS.ErrnoException}.
* We only typically care about the `code` property, so that's what we check for here.
*/
export function isErrnoException(
error: unknown,
): error is NodeJS.ErrnoException {
return (
typeof error === "object" &&
error !== null &&
"code" in error &&
typeof error.code === "string"
);
}
/**
* Decides whether `e` is a disk-related error outside of our control
* that should be classified as a `ConfigurationError`.