Skip to content

Commit 3dcf777

Browse files
committed
fix empty last error in FileUtils
1 parent 5b7d548 commit 3dcf777

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Utils/FileUtils.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* This file is part of the Cloudinary PHP package.
45
*
@@ -137,7 +138,7 @@ public static function safeFileOpen(string $filename, string $mode, bool $useInc
137138

138139
if (! $fp) {
139140
$err = error_get_last();
140-
throw new GeneralError($err['message']);
141+
throw new GeneralError($err['message'] ?? 'Failed to open file: ' . $filename);
141142
}
142143

143144
return $fp;

0 commit comments

Comments
 (0)