From 816720d708e9800cb7861e479aa5f655bb1a2b8d Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Wed, 29 Sep 2021 06:55:40 -0700 Subject: [PATCH] Stop reporting 'Failed to fetch' errors Summary: Failed to fetch promise rejections should not be reported Reviewed By: passy Differential Revision: D31266851 fbshipit-source-id: ce3c15db5504c01d66b44e032c2b7fb752ec2ec3 --- desktop/app/src/utils/errors.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop/app/src/utils/errors.tsx b/desktop/app/src/utils/errors.tsx index 39c1116a3..dd3e95090 100644 --- a/desktop/app/src/utils/errors.tsx +++ b/desktop/app/src/utils/errors.tsx @@ -20,7 +20,11 @@ export function isAuthError( export function isConnectivityOrAuthError( err: any, ): err is ConnectivityError | UserNotSignedInError | UserUnauthorizedError { - return err instanceof ConnectivityError || isAuthError(err); + return ( + err instanceof ConnectivityError || + isAuthError(err) || + String(err).startsWith('Failed to fetch') + ); } export class CancelledPromiseError extends Error {