Improve error propagation from newMediaObject failure in xmlrpc.php. Props Daniel Jalkut (Red Sweater Software). fixes #3981 for 2.2
git-svn-id: http://svn.automattic.com/wordpress/trunk@5054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4432eb12e7
commit
7136d65028
|
@ -1418,8 +1418,9 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
|
||||
$upload = wp_upload_bits($name, $type, $bits, $overwrite);
|
||||
if ( ! empty($upload['error']) ) {
|
||||
logIO('O', '(MW) Could not write file '.$name);
|
||||
return new IXR_Error(500, 'Could not write file '.$name);
|
||||
$errorString = 'Could not write file ' . $name . ' (' . $upload['error'] . ')';
|
||||
logIO('O', '(MW) ' . $errorString);
|
||||
return new IXR_Error(500, $errorString);
|
||||
}
|
||||
// Construct the attachment array
|
||||
// attach to post_id -1
|
||||
|
|
Loading…
Reference in New Issue