MCPcopy Create free account
hub / github.com/Effect-TS/effect / tryPromise

Function tryPromise

packages/platform/deno/src/DenoFileSystem.ts:16–24  ·  view source on GitHub ↗
(
  method: string,
  pathOrDescriptor: string | number | undefined,
  evaluate: (signal: AbortSignal) => PromiseLike<A>
)

Source from the content-addressed store, hash-verified

14import { handleError } from "./internal/error.ts"
15
16const tryPromise = <A>(
17 method: string,
18 pathOrDescriptor: string | number | undefined,
19 evaluate: (signal: AbortSignal) => PromiseLike<A>
20) =>
21 Effect.tryPromise({
22 try: evaluate,
23 catch: handleError("FileSystem", method, pathOrDescriptor)
24 })
25
26const close = (file: Deno.FsFile, method: string, pathOrDescriptor: string | number) =>
27 Effect.orDie(Effect.try({

Callers 15

accessFunction · 0.70
copyFunction · 0.70
copyFileFunction · 0.70
chmodFunction · 0.70
chownFunction · 0.70
linkFunction · 0.70
makeDirectoryFunction · 0.70
makeTempDirectoryFactoryFunction · 0.70
removeFactoryFunction · 0.70
statMethod · 0.70
syncMethod · 0.70
readChunkMethod · 0.70

Calls 1

handleErrorFunction · 0.90

Tested by

no test coverage detected