Skip to content

InvestigationContext ​

ts
type InvestigationContext = object;

The failed call, as passed to callbacks, custom prompts, getSignal and investigate.

Properties ​

error ​

ts
error: unknown;

What the decorated method threw or rejected with.


methodName ​

ts
methodName: string;

The method's name; String(symbol) for a symbol-named method.


methodSource ​

ts
methodSource: string;

The decorated method's code as loaded at runtime (Function.prototype.toString()), so compiled and possibly minified rather than the original TypeScript. Decorators applied below @trypatch replace the method first, so this is their wrapper's code instead.


args ​

ts
args: unknown[];

The call's raw arguments, except in a custom InvestigationBehavior.prompt, which gets them after sanitizeArgs.


methodMetadata ​

ts
methodMetadata: object;

Where the method is defined and how.

className? ​

ts
optional className?: string;

Name of the class (or the instance's class) the method was called on, when it has one.

static ​

ts
static: boolean;

Whether it's a static method.

private ​

ts
private: boolean;

Whether it's a #private method; always false with legacy decorators.


timing ​

ts
timing: object;

When the failed call started and how long it ran before failing.

startedAt ​

ts
startedAt: Date;

When the decorated method was called.

durationMs ​

ts
durationMs: number;

Milliseconds from the call to its failure, measured with a monotonic clock.