MCPcopy Create free account
hub / github.com/vercel/vercel / isErrnoException

Function isErrnoException

packages/python-analysis/src/util/error.ts:3–12  ·  view source on GitHub ↗
(
  error: unknown,
  code: string | undefined = undefined
)

Source from the content-addressed store, hash-verified

1import util from 'node:util';
2
3export const isErrnoException = (
4 error: unknown,
5 code: string | undefined = undefined
6): error is NodeJS.ErrnoException => {
7 return (
8 util.types.isNativeError(error) &&
9 'code' in error &&
10 (code === undefined || error.code === code)
11 );
12};
13
14interface PythonAnalysisErrorProps {
15 /**

Callers 1

readFileIfExistsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected