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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1d5a2d876f
commit
816720d708
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user