There is a bug in file $INCLUDE\ajax.draft.php function _uploadInlineImage($draft). After calling AttachmentFile::format, there is no check for errors found when uploading a file - say a large image.
Suggested solution. After checking for only a single file, add the following code
if ($file[0]['error']!==""){
return Http::response(400,
JsonDataEncoder::encode(array(
'error' => $file[0]['error']
))
);
}