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

Function guarded

packages/effect/src/ui/MessageLog.ts:1971–1977  ·  view source on GitHub ↗
(f: () => Schema.Json)

Source from the content-addressed store, hash-verified

1969const failed: Schema.Json = { "~unserialisable": "encode" }
1970/** Reading a value can throw, from a getter. The log gets a placeholder for it instead. */
1971const guarded = (f: () => Schema.Json): Schema.Json => {
1972 try {
1973 return f()
1974 } catch {
1975 return failed
1976 }
1977}
1978
1979interface Walk {
1980 readonly path: Set<object>

Callers 5

encodeWithFunction · 0.70
encodeObjectFunction · 0.70
fallbackFunction · 0.70
encodeArgsFunction · 0.70
structuralFunction · 0.70

Calls 1

fFunction · 0.50

Tested by

no test coverage detected