# captureStackTrace

`import { captureStackTrace } from "destack:error";`

Capture a structured stack trace for the current Worker.

```ds title="captureStackTrace"
export declare function captureStackTrace(options?: StackTraceOptions | undefined): readonly StackFrame[]
```

[language/library/src/error/stack.ds:55](https://github.com/destack-sh/destack/blob/main/language/library/src/error/stack.ds#L55)
