Skip to content

Commit

Permalink
feat: send error to rollbar when submit work experience form failed (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
barry800414 authored Sep 1, 2024
1 parent e82850f commit 67b692c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ import { tabType } from '../../../constants/companyJobTitle';
import { createWorkExperienceWithRating } from 'actions/experiences';
import { transferKeyToSnakecase } from 'utils/objectUtil';
import { GA_CATEGORY, GA_ACTION } from 'constants/gaConstants';
import { ERROR_CODE_MSG } from 'constants/errorCodeMsg';

import { sendEvent } from 'utils/hotjarUtil';
import rollbar from 'utils/rollbar';

const header = <Header title="分享你的工作心得(評價)" />;

Expand Down Expand Up @@ -137,6 +139,11 @@ const TypeForm = ({ open, onClose, hideProgressBar = false }) => {
category: GA_CATEGORY.SHARE_WORK,
action: GA_ACTION.UPLOAD_FAIL,
});
const errorCode = 'ER0020';
rollbar.error(
`[${errorCode}] ${ERROR_CODE_MSG[errorCode].internal} ${error.message}`,
error,
);
}, []);

return (
Expand Down
3 changes: 3 additions & 0 deletions src/constants/errorCodeMsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,7 @@ export const ERROR_CODE_MSG = {
ER0019: {
internal: 'Not submittable',
},
ER0020: {
internal: 'Submit work experience failed',
},
};

0 comments on commit 67b692c

Please sign in to comment.