MCPcopy Create free account
hub / github.com/mongodb/node-mongodb-native / makeErrorModule

Function makeErrorModule

src/deps.ts:5–18  ·  view source on GitHub ↗
(error: any)

Source from the content-addressed store, hash-verified

3import type { Callback } from './utils';
4
5function makeErrorModule(error: any) {
6 const props = error ? { kModuleError: error } : {};
7 return new Proxy(props, {
8 get: (_: any, key: any) => {
9 if (key === 'kModuleError') {
10 return error;
11 }
12 throw error;
13 },
14 set: () => {
15 throw error;
16 }
17 });
18}
19
20export type Kerberos = typeof import('kerberos') | { kModuleError: MongoMissingDependencyError };
21

Callers 4

getKerberosFunction · 0.85
getZstdLibraryFunction · 0.85
getAwsCredentialProviderFunction · 0.85
getGcpMetadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected