exception texts improved

This commit is contained in:
Miroslav Šedivý 2019-12-23 19:09:04 +01:00
parent 369f66d896
commit 65b664b678
4 changed files with 4 additions and 4 deletions

View file

@ -12,7 +12,7 @@ class Config
$config_file = PROJECT_PATH.self::CONFIG;
if(!is_readable($config_file)){
throw new ConfigException('Cannot read config file');
throw new ConfigException('Cannot read config file.');
}
self::$_settings = parse_ini_file($config_file);

View file

@ -26,7 +26,7 @@ class DB
$socket = Config::get_safe('mysql_socket', false);
if($socket === false && $host === false){
throw new DBException("Mysql host or socket must be defined");
throw new DBException("Mysql host or socket must be defined.");
}
// Try to connect

View file

@ -130,7 +130,7 @@ class Image
// Save path
if(!move_uploaded_file($_FILES['file']['tmp_name'], $path)){
throw new Exception("Can't write to image folders `i` and `t`.");
throw new Exception("File cannot be written to image folders.");
}
// Create thumb

View file

@ -136,7 +136,7 @@ class SplClassLoader
$full = ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
if (!file_exists($full)) {
throw new Exception("Class file for '".$className."' not found.");
throw new Exception(sprintf('Class file for "%s" not found.', $className));
}
require $full;