Use new method MDWrongFileType::throw() for improved error handling
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -755,7 +755,7 @@ public static function mime_content_type(string $filepath):string {
|
|||||||
throw new Exception("Cannot open finfo context");
|
throw new Exception("Cannot open finfo context");
|
||||||
}
|
}
|
||||||
if (!($mime_type = finfo_file($finfo, $filepath))) {
|
if (!($mime_type = finfo_file($finfo, $filepath))) {
|
||||||
throw new MDWrongFileType("Cannot get mime type of file: " . basename($filepath));
|
MDWrongFileType::throw("Cannot get mime type of file: " . basename($filepath), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $mime_type;
|
return $mime_type;
|
||||||
|
|||||||
Reference in new issue
Block a user