From f4026c1df52b5f8f61d231042eec07b8877d3c7c Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 31 May 2010 06:04:51 +0000 Subject: [PATCH] - catch exception if update.log can't be opened in /tmp/ (which should never happen) --- install/updatesql.php | 9 ++++++++- lng/english.lng.php | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/install/updatesql.php b/install/updatesql.php index 375f0f92..8e2beec3 100644 --- a/install/updatesql.php +++ b/install/updatesql.php @@ -22,7 +22,14 @@ $updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'), $db, $updatelogfile = validateUpdateLogFile(makeCorrectFile(dirname(__FILE__).'/update.log')); $filelog = FileLogger::getInstanceOf(array('loginname' => 'updater'), $settings); $filelog->setLogFile($updatelogfile); -$filelog->logAction(ADM_ACTION, LOG_WARNING, '-------------- START LOG --------------'); + +// if first writing does not work we'll stop, tell the user to fix it +// and then let him try again. +try { + $filelog->logAction(ADM_ACTION, LOG_WARNING, '-------------- START LOG --------------'); +} catch(Exception $e) { + standard_error('exception', $e->getMessage()); +} /* * since froxlor, we have to check if there's still someone diff --git a/lng/english.lng.php b/lng/english.lng.php index 6dc72f20..6d5303b5 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1420,4 +1420,7 @@ $lng['redirect_desc']['rc_found'] = 'found'; $lng['redirect_desc']['rc_seeother'] = 'see other'; $lng['redirect_desc']['rc_tempred'] = 'temporary redirect'; +// ADDED UN FROXLOR 0.9.8 +$lng['error']['exception'] = '%s'; + ?>