diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e2092f83..16910ec97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +* **Build 16x** (2014-12-xx) + - Config item `cms.customErrorPage` is deprecated, the setting `app.debug` should be used instead. + * **Build 167** (2014-12-06) - Settings pages now have a *Reset to default* button. - The field `authorUrl` has been renamed to `homepage` in theme.yaml files. diff --git a/app/config/app.php b/app/config/app.php index a2adb5332..176447566 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -11,6 +11,9 @@ return array( | stack traces will be shown on every error that occurs within your | application. If disabled, a simple generic error page is shown. | + | You can create a CMS page with route "/error" to set the contents + | of this page. Otherwise a default error page is shown. + | */ 'debug' => true, diff --git a/app/config/cms.php b/app/config/cms.php index 088b9de3d..ba93e8722 100644 --- a/app/config/cms.php +++ b/app/config/cms.php @@ -111,19 +111,6 @@ return array( 'urlCacheTtl' => 10, - /* - |-------------------------------------------------------------------------- - | Determines if a friendly error page should be used. - |-------------------------------------------------------------------------- - | - | If this value is set to true, a friendly error page is used when an - | exception is encountered. You must create a CMS page with route "/error" - | to set the contents of this page. Otherwise the default error page is shown. - | - */ - - 'customErrorPage' => false, - /* |-------------------------------------------------------------------------- | Determines if the asset caching is enabled. diff --git a/app/config/testing/cms.php b/app/config/testing/cms.php index b53589f52..7343d99a2 100644 --- a/app/config/testing/cms.php +++ b/app/config/testing/cms.php @@ -75,19 +75,6 @@ return array( 'urlCacheTtl' => 1, - /* - |-------------------------------------------------------------------------- - | Determines if a friendly error page should be used. - |-------------------------------------------------------------------------- - | - | If this value is set to true, a friendly error page is used when an - | exception is encountered. You must create a CMS page with route "/error" - | to set the contents of this page. Otherwise the default error page is shown. - | - */ - - 'customErrorPage' => true, - /* |-------------------------------------------------------------------------- | Determines if the asset caching is enabled. diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 9a5a4f68b..b726cfbde 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -518,19 +518,18 @@ class Controller extends BaseController } catch (Exception $ex) { /* - * Display a "dumbed down" error if custom page is activated - * otherwise display a more detailed error. + * Display a more detailed error if debug mode is activated. */ - if (Config::get('cms.customErrorPage', false)) { - return Response::make($ex->getMessage(), 500); + if (Config::get('app.debug', false)) { + return Response::make(sprintf( + '"%s" on line %s of %s', + $ex->getMessage(), + $ex->getLine(), + $ex->getFile() + ), 500); } - return Response::make(sprintf( - '"%s" on line %s of %s', - $ex->getMessage(), - $ex->getLine(), - $ex->getFile() - ), 500); + return Response::make($ex->getMessage(), 500); } } diff --git a/modules/system/classes/ErrorHandler.php b/modules/system/classes/ErrorHandler.php index b9bf298e0..2e572dda7 100644 --- a/modules/system/classes/ErrorHandler.php +++ b/modules/system/classes/ErrorHandler.php @@ -55,7 +55,7 @@ class ErrorHandler } // Friendly error pages are used - if (Config::get('cms.customErrorPage')) { + if (!Config::get('app.debug', false)) { return $this->handleCustomError(); }