You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(feedback)!: always reject sendFeedback with an Error (#20475)
`sendFeedback` currently rejects with an `Error` in some paths and a raw
string in others. This normalizes all paths to reject with an `Error`,
which is the expected shape and easier to handle for consumers.
Breaking: intended for the next major.
Copy file name to clipboardExpand all lines: MIGRATION.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -613,6 +613,22 @@ on casing, or use `tracePropagationTargets` in combination with a more specific
613
613
As part of this, the `g` and `y` flags are ignored on `tracePropagationTargets` regular expressions. These flags made
614
614
matching stateful via `lastIndex`, so a target like `/myApi\.com/g` previously matched only every other request.
615
615
616
+
### `sendFeedback` rejects with an `Error`
617
+
618
+
Affected SDKs: All SDKs running in the browser.
619
+
620
+
`Sentry.sendFeedback()` now rejects with an `Error` in all cases. Previously it rejected with a plain string when the request timed out, was rejected with a 403, or otherwise failed to send, while the synchronous validation paths (empty message, no client configured) already threw an `Error`. The message text itself is unchanged, and is still customizable through the `errorMessages` hint, so read it off `error.message`:
621
+
622
+
```js
623
+
try {
624
+
awaitSentry.sendFeedback({ message:'Hello' });
625
+
} catch (error) {
626
+
// v10: a string on send failures, an Error on validation failures
0 commit comments