apps/web: show apollo error for user
This commit is contained in:
parent
c9326697f6
commit
f7110497d3
@ -1,8 +1,10 @@
|
|||||||
/* eslint-disable sonarjs/cognitive-complexity */
|
/* eslint-disable sonarjs/cognitive-complexity */
|
||||||
|
import { message } from '@/Components/Common/Notification';
|
||||||
import getUrls from '@/config/urls';
|
import getUrls from '@/config/urls';
|
||||||
import { ApolloLink, from, HttpLink } from '@apollo/client';
|
import { ApolloLink, from, HttpLink } from '@apollo/client';
|
||||||
import { onError } from '@apollo/client/link/error';
|
import { onError } from '@apollo/client/link/error';
|
||||||
import { getCurrentScope } from '@sentry/nextjs';
|
import { getCurrentScope } from '@sentry/nextjs';
|
||||||
|
import { isServer } from 'tools';
|
||||||
|
|
||||||
const { URL_CRM_GRAPHQL } = getUrls();
|
const { URL_CRM_GRAPHQL } = getUrls();
|
||||||
|
|
||||||
@ -63,6 +65,13 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, response })
|
|||||||
const scope = getCurrentScope();
|
const scope = getCurrentScope();
|
||||||
scope.setTag('operationName', operation.operationName);
|
scope.setTag('operationName', operation.operationName);
|
||||||
|
|
||||||
|
if (!isServer()) {
|
||||||
|
message.error({
|
||||||
|
content: `Ошибка во время загрузки данных из CRM`,
|
||||||
|
key: 'APOLLO_GRAPHQL',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
scope.setExtras({
|
scope.setExtras({
|
||||||
graphQLErrors,
|
graphQLErrors,
|
||||||
networkError,
|
networkError,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user