MCPcopy Create free account
hub / github.com/bytebase/dbhub / isModuleNotFound

Function isModuleNotFound

src/utils/module-loader.ts:38–44  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

36 * e.g. when "mssql" is installed but its transitive dep "@azure/core-client" is not.
37 */
38export function isModuleNotFound(err: unknown): boolean {
39 if (!(err instanceof Error) || !("code" in err)) {
40 return false;
41 }
42 const code = (err as NodeJS.ErrnoException).code;
43 return code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND";
44}
45
46export interface ConnectorModule {
47 load: () => Promise<unknown>;

Callers 2

loadConnectorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected