• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alkem-io / client-web / #5946

12 Oct 2023 10:55AM UTC coverage: 6.276%. First build
#5946

Pull #4943

travis-ci

Pull Request #4943: GraphQL errors logged in Sentry & APM

173 of 8224 branches covered (0.0%)

Branch coverage included in aggregate %.

38 of 38 new or added lines in 7 files covered. (100.0%)

1294 of 15151 relevant lines covered (8.54%)

0.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/core/apollo/graphqlLinks/useErrorHandlerLink.ts
1
import { AlkemioGraphqlErrorCode } from '@/main/constants/errors';
2
import { ApolloError } from '@apollo/client';
3
import { onError } from '@apollo/client/link/error';
4
import { useApolloErrorHandler } from '../hooks/useApolloErrorHandler';
5

6
// Don't report these errors in the bottom right corner
×
7
const EXCLUDE_FROM_GLOBAL_HANDLER_ERRORS = [
×
8
  AlkemioGraphqlErrorCode.FORBIDDEN,
9
  AlkemioGraphqlErrorCode.FORBIDDEN_POLICY,
×
10
  AlkemioGraphqlErrorCode.URL_RESOLVER_ERROR,
11
];
×
12

×
13
export const useErrorHandlerLink = () => {
14
  const handleError = useApolloErrorHandler();
×
15

16
  return onError(({ graphQLErrors, networkError }) => {
17
    const nonForbiddenGraphqlErrors = graphQLErrors?.filter(
18
      x => !EXCLUDE_FROM_GLOBAL_HANDLER_ERRORS.includes(x.extensions?.code as AlkemioGraphqlErrorCode)
19
    );
20
    handleError(
21
      new ApolloError({
22
        graphQLErrors: nonForbiddenGraphqlErrors,
23
        networkError,
24
        extraInfo: 'Error caught from the errorReporterLink',
25
      })
26
    );
27
  });
28
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc