Evaluates expr and reports any error to GlitchTip before letting it
propagate. Uses withCallingHandlers() internally so the full call stack
is preserved in the report.
Arguments
- gt
A
gt_connectionobject created bygt_connect().- expr
An expression to evaluate (supports
{ }blocks).- request
Optional plumber2
requestobject. When provided, the endpoint path and HTTP method are included in the error report.
Details
If gt is an inactive connection (no DSN configured), expr is evaluated
normally and nothing is reported.
Examples
# With an inactive connection (no DSN), gt_capture() is a transparent no-op
gt <- gt_connect()
result <- gt_capture(gt, 1 + 1)
