mirror of
https://github.com/outline/outline.git
synced 2026-08-03 13:27:25 +03:00
fix: Suppress 499 error reporting (#13165)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user