Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display error when image fails to upload and server returns error message #7137

Closed
danielbachhuber opened this issue Jun 5, 2018 · 1 comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended

Comments

@danielbachhuber
Copy link
Member

danielbachhuber commented Jun 5, 2018

In the WordPress Media Library, a failed image upload will display the specific error returned by the server:

image

However, Gutenberg displays a generic "Error while uploading" message:

image

It would be better to display the specific error message.

This scenario can be reproduced with the following code snippet:

$force_upload_failure = function( $file ) {
	$file['error'] = 'This file upload has been forced to fail.';
	return $file;
};
add_filter( 'wp_handle_sideload_prefilter', $force_upload_failure );
add_filter( 'wp_handle_upload_prefilter', $force_upload_failure );

Tested with Gutenberg 3.0.

@danielbachhuber danielbachhuber added [Type] Bug An existing feature does not function as intended [Feature] Media Anything that impacts the experience of managing media labels Jun 5, 2018
@danielbachhuber danielbachhuber added this to the WordPress 5.0 milestone Jun 5, 2018
@danielbachhuber
Copy link
Member Author

This might need to wait until #6968 lands to avoid refactor conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant