@beignet/provider-error-reporting-sentry 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +28 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @beignet/provider-error-reporting-sentry
|
|
2
2
|
|
|
3
|
+
## 0.0.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2a02469: Add `createErrorReportingHooks(...)` for capturing unexpected HTTP failures
|
|
8
|
+
through `ctx.ports.errorReporter`, and wire generated apps to install the hook
|
|
9
|
+
with a no-op local reporter by default.
|
|
10
|
+
|
|
3
11
|
## 0.0.14
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -31,6 +31,34 @@ With no `dsn` or `SENTRY_DSN`, the provider still contributes the Beignet port
|
|
|
31
31
|
but does not initialize Sentry. This is useful for examples and local apps that
|
|
32
32
|
want stable wiring before production secrets exist.
|
|
33
33
|
|
|
34
|
+
## Capture HTTP failures
|
|
35
|
+
|
|
36
|
+
Register `createErrorReportingHooks(...)` in `server/index.ts` so unexpected
|
|
37
|
+
route and server failures are captured through `ctx.ports.errorReporter`.
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { createErrorReportingHooks } from "@beignet/core/server";
|
|
41
|
+
import { createNextServer } from "@beignet/next";
|
|
42
|
+
import type { AppContext } from "@/app-context";
|
|
43
|
+
import { appPorts } from "@/infra/app-ports";
|
|
44
|
+
import { appContext } from "./context";
|
|
45
|
+
import { providers } from "./providers";
|
|
46
|
+
import { routes } from "./routes";
|
|
47
|
+
|
|
48
|
+
export const server = await createNextServer({
|
|
49
|
+
ports: appPorts,
|
|
50
|
+
providers,
|
|
51
|
+
hooks: [createErrorReportingHooks<AppContext>()],
|
|
52
|
+
context: appContext,
|
|
53
|
+
routes,
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The hook skips expected application catalog errors, auth denials, tenant
|
|
58
|
+
requirements, idempotency conflicts, entitlement denials, and request validation
|
|
59
|
+
failures by default. Use `mapUnhandledError` for response bodies; the hook only
|
|
60
|
+
observes and reports.
|
|
61
|
+
|
|
34
62
|
## Use
|
|
35
63
|
|
|
36
64
|
```typescript
|