Skip to content

Commit

Permalink
Include error message in snackbar notice.
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyBJacobs committed Jun 27, 2020
1 parent ecaa86c commit 5519045
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/block-library/src/image/image-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
MenuGroup,
MenuItem,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import { useDispatch } from '@wordpress/data';
import apiFetch from '@wordpress/api-fetch';

Expand Down Expand Up @@ -188,10 +188,12 @@ export default function ImageEditor( {
height: height && width ? width / aspect : undefined,
} );
} )
.catch( () => {
.catch( ( error ) => {
createErrorNotice(
__(
'Unable to perform the image modification. Please check your media storage.'
sprintf(
/* translators: 1. Error message */
__( 'Could not edit image. %s' ),
error.message
),
{
id: 'image-editing-error',
Expand Down

0 comments on commit 5519045

Please sign in to comment.