Skip to main content

traceRequest

@webda/core


Function: traceRequest()

traceRequest<T>(request, fn): Promise<T>

Defined in: packages/core/src/services/requesttracer.ts:78

Run fn under the registered tracer, or directly with a no-op handle when none

A failing tracer never breaks the request: if it fails before calling fn, fn is run directly. Once fn was called, its own result or error is returned as is and it is never run twice.

Type Parameters​

T​

T

Parameters​

request​

TracedRequest

the request description

fn​

(handle) => Promise<T>

the processing to trace

Returns​

Promise<T>

the result of fn