Skip to content

Commit 2f28cb0

Browse files
authored
MON-1977 [Client Sentry] (#37)
1 parent d1f3074 commit 2f28cb0

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

frontend/src/components/Layout/Sidebar/components/UserInfo/components/ReportModal/ReportModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,27 @@ export const ReportModal: FC<ReportModalProps> = ({ open, onClose }) => {
3232
e.preventDefault();
3333
if (inputDescription !== '' && selectedFile !== undefined) {
3434
const reader = new FileReader();
35+
3536
reader.onloadend = function () {
3637
const result = reader.result as string;
3738
const [imageData, path] = result.split(';');
3839
const [type] = imageData.split(':');
3940
const [currentPath] = path.split(',');
41+
4042
Sentry.configureScope(scope => {
4143
scope.addAttachment({ filename: 'screenshot', data: currentPath, contentType: type });
4244
});
43-
logger.warn(`The report was sent by a user, message: ${inputDescription}`);
45+
46+
logger.info(`The report was sent by a user, message: ${inputDescription}`);
47+
4448
Sentry.configureScope(scope => {
4549
scope.clearAttachments();
4650
});
51+
4752
setInputDescription('');
4853
onClose();
4954
};
55+
5056
reader.readAsDataURL(selectedFile);
5157
}
5258
};

frontend/src/components/WorkspaceSettings/Billing/BillingMethods/BillingMethodDialog.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ const BillingMethodDialog = ({ isDialogOpen, handleCloseDialog }: BillingMethodD
4242

4343
if (paymentMethod.error) {
4444
setErrorMessage(paymentMethod.error.message as string);
45-
46-
logger.error(paymentMethod.error);
45+
logger.error('Error on create stripe payment method', paymentMethod.error);
4746
} else {
4847
updatePaymentMethodApiV1BillingPaymentMethodPost({ payment_method_id: paymentMethod.paymentMethod.id });
4948

frontend/src/components/WorkspaceSettings/Billing/FirstBilling/FirstBillingPayment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const FirstBillingPayment = () => {
3737
if (error) {
3838
setIsLoading(false);
3939
setErrorMessage(error.message as string);
40-
logger.error(error);
40+
logger.error('Error on confirm stripe payment', error);
4141
}
4242

4343
setIsLoading(false);

frontend/src/helpers/services/customAxios.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ AXIOS_INSTANCE.interceptors.response.use(
2828
} else if (response.status === 451 && window.location.pathname !== '/license-agreement') {
2929
window.location.href = '/license-agreement';
3030
} else {
31-
logger.warn('Error from client on axios request', response); // 400...
32-
3331
return response;
3432
}
3533
}
3634

37-
logger.warn('Server error from client on axios request', error); // 500...
35+
logger.error('Err on axios request', { err_details: error });
3836

3937
return { error_message: 'Internal server error', additional_information: {} };
4038
}

frontend/src/helpers/tierControl.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React, { ReactNode, useEffect, useState } from 'react';
22

3-
import logger from './services/logger';
4-
53
import { getAvailableFeaturesApiV1OrganizationAvailableFeaturesGet } from 'api/generated';
64

5+
import { resError } from './types/resError';
6+
77
interface Dict {
88
type: { [key: string]: number | boolean };
99
}
@@ -20,12 +20,10 @@ export const featuresList = {
2020
};
2121

2222
const getFeaturesStatus = async ({ setFeatures }: { setFeatures: (arg: Dict['type']) => void }) => {
23-
try {
24-
const response = (await getAvailableFeaturesApiV1OrganizationAvailableFeaturesGet()) as unknown as Dict['type'];
23+
const response = (await getAvailableFeaturesApiV1OrganizationAvailableFeaturesGet()) as unknown as Dict['type'];
2524

25+
if (response && !(response as unknown as resError).error_message) {
2626
setFeatures(response);
27-
} catch (err) {
28-
logger.error(err);
2927
}
3028
};
3129

0 commit comments

Comments
 (0)