diff --git a/www/lib/CoreLibs/Convert/Byte.php b/www/lib/CoreLibs/Convert/Byte.php index ebec727a..b0d05ece 100644 --- a/www/lib/CoreLibs/Convert/Byte.php +++ b/www/lib/CoreLibs/Convert/Byte.php @@ -37,7 +37,7 @@ class Byte * BYTE_FORMAT_ADJUST: sprintf adjusted two 2 decimals * BYTE_FORMAT_SI: use 1000 instead of 1024 * @return string converted byte number (float) with suffix - * @throws \Exception 1: no valid flag set + * @throws \InvalidArgumentException 1: no valid flag set */ public static function humanReadableByteFormat(string|int|float $bytes, int $flags = 0): string { @@ -63,7 +63,7 @@ class Byte $si = false; } if ($flags > 7) { - throw new \Exception("Invalid flags parameter: $flags", 1); + throw new \InvalidArgumentException("Invalid flags parameter: $flags", 1); } // si or normal @@ -119,7 +119,7 @@ class Byte * @param int $flags bitwise flag with use space turned on * BYTE_FORMAT_SI: use 1000 instead of 1024 * @return string|int|float converted value or original value - * @throws \Exception 1: no valid flag set + * @throws \InvalidArgumentException 1: no valid flag set */ public static function stringByteFormat(string|int|float $number, int $flags = 0): string|int|float { @@ -130,7 +130,7 @@ class Byte $si = false; } if ($flags != 0 && $flags != 4) { - throw new \Exception("Invalid flags parameter: $flags", 1); + throw new \InvalidArgumentException("Invalid flags parameter: $flags", 1); } // matches in regex $matches = []; diff --git a/www/lib/CoreLibs/Output/Image.php b/www/lib/CoreLibs/Output/Image.php index 897e6495..4114494e 100644 --- a/www/lib/CoreLibs/Output/Image.php +++ b/www/lib/CoreLibs/Output/Image.php @@ -78,7 +78,7 @@ class Image if (!empty($dummy) && file_exists($filename) && is_file($filename)) { $return_data = $filename; } else { - throw new \Exception('Could not set dummy return file: ' . $dummy . ' in ' . $filename); + throw new \RuntimeException('Could not set dummy return file: ' . $dummy . ' in ' . $filename); } } else { $return_data = $dummy;