]> git.mxchange.org Git - friendica.git/commitdiff
Use old error message when storing fails
authorMichael <heluecht@pirati.ca>
Tue, 9 May 2023 05:32:52 +0000 (05:32 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 9 May 2023 05:32:52 +0000 (05:32 +0000)
src/Model/Photo.php
src/Module/Media/Photo/Upload.php

index e07b6b6af631eb81d5125beb3df4b921bdf88d3f..fbe7ac49e6979e97fe36ff6cf02d07ef1d7cc21c 100644 (file)
@@ -1194,7 +1194,7 @@ class Photo
 
                $smallest = self::storeWithPreview($image, $user['uid'], $resource_id, $filename, $filesize, $album, $desc, $allow_cid, $allow_gid, $deny_cid, $deny_gid);
                if ($smallest < 0) {
-                       Logger::notice('Photo not stored', ['resource-id' => $resource_id]);
+                       Logger::warning('Photo could not be stored', ['uid' => $user['uid'], 'resource_id' => $resource_id, 'filename' => $filename, 'album' => $album]);                       Logger::notice('Photo not stored', ['resource-id' => $resource_id]);
                        return [];
                }
 
index d000933887b9d9d47f6749eb8eee4ba081094d6b..7d7482fccd21b55979e44194b98d20fb66a60b56 100644 (file)
@@ -175,8 +175,8 @@ class Upload extends \Friendica\BaseModule
 
                $smallest = Photo::storeWithPreview($image, $owner['uid'], $resource_id, $filename, $filesize, $album, '', $allow_cid, '', '', '');
                if ($smallest < 0) {
-                       $this->return(401, $this->t('Image could not be uploaded'));
-                       @unlink($src);
+                       $this->logger->warning('Photo::store() failed');
+                       $this->return(401, $this->t('Image upload failed.'));
                }
 
                $this->logger->info('upload done');