Uploader: Route plupload errors to the correct handler and prevent naming conflicts. see #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-21 20:17:25 +00:00
parent 46020c6dd0
commit 095093e390

View File

@ -211,19 +211,19 @@ window.wp = window.wp || {};
self.success( file.attachment );
});
this.uploader.bind( 'Error', function( up, error ) {
this.uploader.bind( 'Error', function( up, pluploadError ) {
var message = pluploadL10n.default_error,
key;
// Check for plupload errors.
for ( key in Uploader.errorMap ) {
if ( error.code === plupload[ key ] ) {
if ( pluploadError.code === plupload[ key ] ) {
message = Uploader.errorMap[ key ];
break;
}
}
self.error( message, error, error.file );
error( message, pluploadError, pluploadError.file );
up.refresh();
});