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:
ryan 2007-03-16 22:12:15 +00:00
parent 4432eb12e7
commit 7136d65028
1 changed files with 3 additions and 2 deletions

View File

@ -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