fix: Suppress 499 error reporting (#13165)

This commit is contained in:
Tom Moor
2026-07-27 18:15:50 -04:00
committed by GitHub
parent 7e6499e71f
commit 3260153f9c
3 changed files with 12 additions and 0 deletions
+7
View File
@@ -12,6 +12,7 @@ import {
AuthorizationError,
BadGatewayError,
BadRequestError,
ClientClosedRequestError,
NetworkError,
NotFoundError,
OfflineError,
@@ -311,6 +312,12 @@ class ApiClient {
);
}
// The client, or an intermediate proxy, closed the connection before the
// response was received there is nothing actionable to report.
if (response.status === 499) {
throw new ClientClosedRequestError(error.message);
}
const err = new RequestError(`Error ${response.status}`);
Logger.error("Request failed", err, {
...error,
+3
View File
@@ -30,6 +30,9 @@ export class UnprocessableEntityError extends ExtendableError {}
/** Error thrown when the client has exceeded the allowed request rate. */
export class RateLimitExceededError extends ExtendableError {}
/** Error thrown when the client closed the connection before a response. */
export class ClientClosedRequestError extends ExtendableError {}
/** Error thrown when a request fails for a generic reason. */
export class RequestError extends ExtendableError {}
+2
View File
@@ -4,6 +4,7 @@ import env from "~/env";
import {
AuthorizationError,
BadRequestError,
ClientClosedRequestError,
NetworkError,
NotFoundError,
OfflineError,
@@ -22,6 +23,7 @@ export function initSentry(history: History) {
const ignoredErrorTypes = [
AuthorizationError,
BadRequestError,
ClientClosedRequestError,
NetworkError,
NotFoundError,
OfflineError,