Improve error propagation from newMediaObject failure in xmlrpc.php. Props Daniel Jalkut (Red Sweater Software). fixes #3981 for 2.2
git-svn-id: https://develop.svn.wordpress.org/trunk@5054 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d4007dfa64
commit
4926111056
|
@ -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