MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / isMongoError

Function isMongoError

packages/core/fumadb/test/shared.ts:395–402  ·  view source on GitHub ↗
(error: unknown, codeName: string)

Source from the content-addressed store, hash-verified

393const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
394
395function isMongoError(error: unknown, codeName: string) {
396 return (
397 typeof error === "object" &&
398 error !== null &&
399 "codeName" in error &&
400 error.codeName === codeName
401 );
402}
403
404async function ensureMongoPrimary(mongodb: MongoClient) {
405 const admin = mongodb.db("admin");

Callers 1

ensureMongoPrimaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected