From a7fcddc48c2ac05c657e0e95813534a184381db4 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 4 Dec 2013 21:36:46 +1100 Subject: [PATCH] Added 500 error message --- classes/lnApp/SystemMessage.php | 5 ++++- views/errors/500.php | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 views/errors/500.php diff --git a/classes/lnApp/SystemMessage.php b/classes/lnApp/SystemMessage.php index b8bec9c..8e462d9 100644 --- a/classes/lnApp/SystemMessage.php +++ b/classes/lnApp/SystemMessage.php @@ -20,7 +20,10 @@ abstract class lnApp_SystemMessage extends HTMLRender { public function __call($name,$args=NULL) { parent::__call($name,$args); - Session::instance()->set('sessionmsgs',static::$_data); + // If we are a CLI session, then we have no session + if (PHP_SAPI !== 'cli') + Session::instance()->set('sessionmsgs',static::$_data); + return $this; } diff --git a/views/errors/500.php b/views/errors/500.php new file mode 100644 index 0000000..75d03ea --- /dev/null +++ b/views/errors/500.php @@ -0,0 +1,6 @@ +

Oops!

+

500 Bother, something went wrong.

+ +
+ If this keeps happening, please let us know. +