Skip to content

Commit

Permalink
Print error message from request, if clipboardRequest return an error (
Browse files Browse the repository at this point in the history
…#5932)

Co-authored-by: Steve Piercy <web@stevepiercy.com>
  • Loading branch information
cekk and stevepiercy authored Mar 28, 2024
1 parent ca64494 commit d22c5e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/volto/news/5932.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Print error message from request in toast, if `clipboardRequest` return an error. @cekk
5 changes: 4 additions & 1 deletion packages/volto/src/components/manage/Contents/Contents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,14 @@ class Contents extends Component {
this.props.clipboardRequest.loading &&
nextProps.clipboardRequest.error
) {
const msgBody =
nextProps.clipboardRequest.error?.response?.body?.message ||
this.props.intl.formatMessage(messages.error);
this.props.toastify.toast.error(
<Toast
error
title={this.props.intl.formatMessage(messages.error)}
content={this.props.intl.formatMessage(messages.error)}
content={msgBody}
/>,
);
}
Expand Down

0 comments on commit d22c5e8

Please sign in to comment.