@sentry/api 0.254.1 → 0.256.0

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.
@@ -5,16 +5,7 @@
5
5
  * These helpers make it ergonomic to paginate through results
6
6
  * returned by the generated SDK functions.
7
7
  */
8
- export type SdkResult<TData = unknown, TError = unknown> = ({
9
- data: TData;
10
- error: undefined;
11
- } | {
12
- data: undefined;
13
- error: TError;
14
- }) & {
15
- request: Request;
16
- response: Response;
17
- };
8
+ import { type SdkResult } from "./sentry-errors";
18
9
  export type UnwrappedResult<TData> = {
19
10
  data: TData;
20
11
  response: Response;
@@ -104,8 +95,11 @@ export declare const _withCursor: <TOptions>(options: {
104
95
  *
105
96
  * Returns `{ data, response }` so callers retain access to the
106
97
  * raw Response (and its headers) for pagination or other needs.
98
+ *
99
+ * The thrown value is a {@link SentryApiError}, so a `catch` block can still
100
+ * read `err.status` / `err.body` to decide how to handle the failure.
107
101
  */
108
- export declare const unwrapResult: <TData>(result: SdkResult<TData>, context: string) => UnwrappedResult<TData>;
102
+ export declare const unwrapResult: <TData, TError = unknown>(result: SdkResult<TData, TError>, context: string) => UnwrappedResult<TData>;
109
103
  /**
110
104
  * Unwrap an SDK result and extract pagination cursors from the
111
105
  * Link header. Throws on error.
@@ -0,0 +1 @@
1
+ export * from "./valibot.gen.ts";