Overview
A failed HTTP request doesn't necessarily throw — a 500 from an upstream API is a normal response as far as fetch() is concerned, and a caught network error never reaches the global handlers. httpErrorsIntegration watches every outgoing request (the global fetch() and node:http / node:https) and sends an error-level log for each one that:
- responds with a status at or above
statusThreshold(500by default), or - fails at the network level (connection refused, DNS failure, timeout).
Each log carries method, url and status as attributes, so you can search and group them on the Logs page. The SDK's own requests to /api/envelope are ignored.
Usage
ts
import { use } from '@buglapse/node'
import { httpErrorsIntegration } from '@buglapse/node/integrations'
use(httpErrorsIntegration())
// report 4xx responses as well:
use(httpErrorsIntegration({ statusThreshold: 400 }))Options
| Option | Type | Default | Description |
|---|---|---|---|
statusThreshold | number | 500 | Lowest response status that's reported |
Your code still receives the response (or the thrown network error) unchanged.