diff --git a/apps/web/apollo/link.js b/apps/web/apollo/link.js index 96c1d02..fa56d00 100644 --- a/apps/web/apollo/link.js +++ b/apps/web/apollo/link.js @@ -1,8 +1,10 @@ /* eslint-disable sonarjs/cognitive-complexity */ +import { message } from '@/Components/Common/Notification'; import getUrls from '@/config/urls'; import { ApolloLink, from, HttpLink } from '@apollo/client'; import { onError } from '@apollo/client/link/error'; import { getCurrentScope } from '@sentry/nextjs'; +import { isServer } from 'tools'; const { URL_CRM_GRAPHQL } = getUrls(); @@ -63,6 +65,13 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, response }) const scope = getCurrentScope(); scope.setTag('operationName', operation.operationName); + if (!isServer()) { + message.error({ + content: `Ошибка во время загрузки данных из CRM`, + key: 'APOLLO_GRAPHQL', + }); + } + scope.setExtras({ graphQLErrors, networkError,