Skip to content

Commit

Permalink
Extract error msg from API response for preview.
Browse files Browse the repository at this point in the history
  • Loading branch information
sharief007 committed Sep 17, 2023
1 parent 40a0d7c commit 879db73
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ export class CommentForm extends Component<Props, State> {
this.props
.getPreview(text)
.then((preview) => this.setState({ preview }))
.catch(() => {
this.setState({ isErrorShown: true, errorMessage: null });
.catch((e) => {
this.setState({ isErrorShown: true, errorMessage: extractErrorMessageFromResponse(e, this.props.intl) });

Check warning on line 184 in frontend/apps/remark42/app/components/comment-form/comment-form.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/apps/remark42/app/components/comment-form/comment-form.tsx#L183-L184

Added lines #L183 - L184 were not covered by tests
});
};

Expand Down

0 comments on commit 879db73

Please sign in to comment.