@@ -196,7 +196,11 @@ private function checkAndUploadToCloudinary($logoPath, $publicId, $originalUrl)
196196
197197 // Clean up temp file if it was downloaded
198198 if (strpos ($ logoFullPath , '/tmp/ ' ) !== false ) {
199- @unlink ($ logoFullPath );
199+ try {
200+ unlink ($ logoFullPath );
201+ } catch (\Exception $ unlinkException ) {
202+ $ this ->logger ->debug ('Could not delete temporary logo file: ' . $ unlinkException ->getMessage ());
203+ }
200204 }
201205
202206 return $ uploadResult ['secure_url ' ];
@@ -274,7 +278,12 @@ private function verifyImageAccessibility($url)
274278 ]
275279 ]);
276280
277- $ headers = @get_headers ($ url , 1 , $ context );
281+ $ headers = false ;
282+ try {
283+ $ headers = get_headers ($ url , 1 , $ context );
284+ } catch (\Exception $ headerException ) {
285+ $ this ->logger ->debug ('Could not retrieve headers for URL: ' . $ headerException ->getMessage ());
286+ }
278287
279288 if ($ headers && isset ($ headers [0 ])) {
280289 // Check for successful HTTP status codes (200, 201, etc.)
0 commit comments