Просмотр исходного кода

fix(ui): Add 400 requests to the ignored errors (#51726)

Scott Cooper 1 год назад
Родитель
Сommit
77c33f8c5d

+ 1 - 1
static/app/bootstrap/initializeSdk.spec.tsx

@@ -14,7 +14,7 @@ const ERROR_MAP = {
 
 describe('isFilteredRequestErrorEvent', () => {
   const methods = ['GET', 'POST', 'PUT', 'DELETE'];
-  const stati = [200, 401, 403, 404, 429];
+  const stati = [200, 400, 401, 403, 404, 429];
 
   describe('matching error type, matching message', () => {
     for (const method of methods) {

+ 4 - 1
static/app/bootstrap/initializeSdk.tsx

@@ -252,6 +252,9 @@ export function isFilteredRequestErrorEvent(event: Event): boolean {
 
     const is200 =
       ['RequestError'].includes(type) && !!value.match('(GET|POST|PUT|DELETE) .* 200');
+    const is400 =
+      ['BadRequestError', 'RequestError'].includes(type) &&
+      !!value.match('(GET|POST|PUT|DELETE) .* 400');
     const is401 =
       ['UnauthorizedError', 'RequestError'].includes(type) &&
       !!value.match('(GET|POST|PUT|DELETE) .* 401');
@@ -265,7 +268,7 @@ export function isFilteredRequestErrorEvent(event: Event): boolean {
       ['TooManyRequestsError', 'RequestError'].includes(type) &&
       !!value.match('(GET|POST|PUT|DELETE) .* 429');
 
-    if (is200 || is401 || is403 || is404 || is429) {
+    if (is200 || is400 || is401 || is403 || is404 || is429) {
       return true;
     }
   }