diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-07-21 22:29:50 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-07-21 22:29:50 +0200 |
commit | df8ad46daef960accd1e307f74e7bcb705e9fc7b (patch) | |
tree | 7848816e8d4aa6074c4d78bdf45cd5f5074e798b /lib/files.php | |
parent | 37a731bcad4636f682a2cbcc59dabc9e60494b01 (diff) | |
download | nextcloud-server-df8ad46daef960accd1e307f74e7bcb705e9fc7b.tar.gz nextcloud-server-df8ad46daef960accd1e307f74e7bcb705e9fc7b.zip |
Change exit calls to throwing an exception
This way the error won't be fatal in a unit test
Diffstat (limited to 'lib/files.php')
-rw-r--r-- | lib/files.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/files.php b/lib/files.php index f5dffd970d2..ce46d13da41 100644 --- a/lib/files.php +++ b/lib/files.php @@ -62,7 +62,7 @@ class OC_Files { $zip = new ZipArchive(); $filename = OC_Helper::tmpFile('.zip'); if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==true) { - exit("cannot open <$filename>\n"); + throw new Exception("cannot open '$filename'\n"); } foreach ($files as $file) { $file = $dir . '/' . $file; @@ -93,7 +93,7 @@ class OC_Files { $zip = new ZipArchive(); $filename = OC_Helper::tmpFile('.zip'); if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==true) { - exit("cannot open <$filename>\n"); + throw new Exception("cannot open '$filename'\n"); } $file = $dir . '/' . $files; self::zipAddDir($file, $zip); |