Index: xmlrpc.php
===================================================================
--- xmlrpc.php	(revision 5049)
+++ xmlrpc.php	(working copy)
@@ -1418,8 +1418,9 @@
 
 		$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

