diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-04-26 11:26:58 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-04-26 11:26:58 +0200 |
commit | f23ef1c96859f6b01a9268c8606a22ceb719cf3d (patch) | |
tree | 7c4ea8f0c79caba006903cffdbeddb31c9154f38 /bin/cleandb.sh | |
parent | ddfdd8938d78b40842a984d310e3c35af30ece0a (diff) |
Fix error handling in CLI mode, use STDERR and non-empty exit code (#1489043)
Diffstat (limited to 'bin/cleandb.sh')
-rwxr-xr-x | bin/cleandb.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/cleandb.sh b/bin/cleandb.sh index ecf258320..ea905c873 100755 --- a/bin/cleandb.sh +++ b/bin/cleandb.sh @@ -34,8 +34,9 @@ $RCMAIL = rcmail::get_instance(); $db = $RCMAIL->get_dbh(); $db->db_connect('w'); -if (!$db->is_connected() || $db->is_error()) - die("No DB connection\n"); +if (!$db->is_connected() || $db->is_error()) { + rcube::raise_error("No DB connection", false, true); +} if (!empty($_SERVER['argv'][1])) $days = intval($_SERVER['argv'][1]); |