parent
6c9947326d
commit
7074fa1331
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
namespace Icinga\Exception;
|
namespace Icinga\Exception;
|
||||||
|
|
||||||
use RuntimeException;
|
class NotWritableError extends IcingaException
|
||||||
|
|
||||||
class NotWritableError extends RuntimeException
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,9 @@ class DbStore extends PreferencesStore
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new NotWritableError(
|
throw new NotWritableError(
|
||||||
'Cannot insert preferences for user ' . $this->getUser()->getUsername() . ' into database', 0, $e
|
'Cannot insert preferences for user %s into database',
|
||||||
|
$this->getUser()->getUsername(),
|
||||||
|
$e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,7 +178,9 @@ class DbStore extends PreferencesStore
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new NotWritableError(
|
throw new NotWritableError(
|
||||||
'Cannot update preferences for user ' . $this->getUser()->getUsername() . ' in database', 0, $e
|
'Cannot update preferences for user %s in database',
|
||||||
|
$this->getUser()->getUsername(),
|
||||||
|
$e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +206,9 @@ class DbStore extends PreferencesStore
|
||||||
);
|
);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new NotWritableError(
|
throw new NotWritableError(
|
||||||
'Cannot delete preferences for user ' . $this->getUser()->getUsername() . ' from database', 0, $e
|
'Cannot delete preferences for user %s from database',
|
||||||
|
$this->getUser()->getUsername(),
|
||||||
|
$e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,10 +98,8 @@ class IniStore extends PreferencesStore
|
||||||
if (!file_exists($this->preferencesFile)) {
|
if (!file_exists($this->preferencesFile)) {
|
||||||
if (!is_writable($this->getStoreConfig()->location)) {
|
if (!is_writable($this->getStoreConfig()->location)) {
|
||||||
throw new NotWritableError(
|
throw new NotWritableError(
|
||||||
sprintf(
|
'Path to the preferences INI files %s is not writable',
|
||||||
'Path to the preferences INI files %s is not writable',
|
$this->getStoreConfig()->location
|
||||||
$this->getStoreConfig()->location
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,8 +108,9 @@ class IniStore extends PreferencesStore
|
||||||
|
|
||||||
if (!is_writable($this->preferencesFile)) {
|
if (!is_writable($this->preferencesFile)) {
|
||||||
throw new NotWritableError(
|
throw new NotWritableError(
|
||||||
'Preferences INI file ' . $this->preferencesFile . ' for user '
|
'Preferences INI file %s for user %s is not writable',
|
||||||
. $this->getUser()->getUsername() . ' is not writable'
|
$this->preferencesFile,
|
||||||
|
$this->getUser()->getUsername()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue