StackTraceContext annotation used to store the stack frame captured at the point of failure.
When to use
Use to read the failure stack-frame annotation from a Reason when building
diagnostics, logging, or custom cause renderers.
Details
The runtime annotates every reason with this when a stack frame is
available. Retrieve it via
Context.get(Cause.reasonAnnotations(reason), Cause.StackTrace).
export class class StackTraceclass StackTrace {
key: Identifier;
Service: {
name: string;
stack: () => string | undefined;
parent: StackFrame | undefined;
};
}
Context annotation used to store the stack frame captured at the point of failure.
When to use
Use to read the failure stack-frame annotation from a Reason when building
diagnostics, logging, or custom cause renderers.
Details
The runtime annotates every reason with this when a stack frame is
available. Retrieve it via
Context.get(Cause.reasonAnnotations(reason), Cause.StackTrace).
StackTrace extends import ContextContext.const Service: {
<Identifier, Shape = Identifier>(
key: string
): Service<Identifier, Shape>
<Self, Shape>(): <
Identifier extends string,
E,
R = Types.unassigned,
Args extends ReadonlyArray<any> = never
>(
id: Identifier,
options?:
| {
readonly make:
| ((
...args: Args
) => Effect<Shape, E, R>)
| Effect<Shape, E, R>
| undefined
}
| undefined
) => ServiceClass<Self, Identifier, Shape> &
([Types.unassigned] extends [R]
? unknown
: {
readonly make: [Args] extends [never]
? Effect<Shape, E, R>
: (
...args: Args
) => Effect<Shape, E, R>
})
<Self>(): <
Identifier extends string,
Make extends
| Effect<any, any, any>
| ((...args: any) => Effect<any, any, any>)
>(
id: Identifier,
options: { readonly make: Make }
) => ServiceClass<
Self,
Identifier,
Make extends
| Effect<infer _A, infer _E, infer _R>
| ((
...args: infer _Args
) => Effect<infer _A, infer _E, infer _R>)
? _A
: never
> & { readonly make: Make }
}
Service<class StackTraceclass StackTrace {
key: Identifier;
Service: {
name: string;
stack: () => string | undefined;
parent: StackFrame | undefined;
};
}
Context annotation used to store the stack frame captured at the point of failure.
When to use
Use to read the failure stack-frame annotation from a Reason when building
diagnostics, logging, or custom cause renderers.
Details
The runtime annotates every reason with this when a stack frame is
available. Retrieve it via
Context.get(Cause.reasonAnnotations(reason), Cause.StackTrace).
StackTrace, StackFrame>()("effect/Cause/StackTrace") {}