From bc0a903bd4ba15f9050f623e599a02095c30442a Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 14 Jan 2016 21:21:34 +0100 Subject: [PATCH] ErrorAction to autodiscoverable file. --- lib/action.php | 4 ++++ lib/clienterroraction.php | 6 +----- lib/{error.php => erroraction.php} | 0 lib/servererroraction.php | 6 +----- 4 files changed, 6 insertions(+), 10 deletions(-) rename lib/{error.php => erroraction.php} (100%) diff --git a/lib/action.php b/lib/action.php index 68019ce108..71441a31ff 100644 --- a/lib/action.php +++ b/lib/action.php @@ -1457,6 +1457,8 @@ class Action extends HTMLOutputter // lawsuit break; default: common_log(LOG_ERR, 'Handled serverError ('._ve($code).') but cannot output into desired format ('._ve($this->format).'): '._ve($msg)); + $action = new ServerErrorAction($msg, $code); + $action->execute(); } exit((int)$code); @@ -1513,6 +1515,8 @@ class Action extends HTMLOutputter // lawsuit break; default: common_log(LOG_ERR, 'Handled clientError ('._ve($code).') but cannot output into desired format ('._ve($this->format).'): '._ve($msg)); + $action = new ClientErrorAction($msg, $code); + $action->execute(); } exit((int)$code); } diff --git a/lib/clienterroraction.php b/lib/clienterroraction.php index 37f722291e..c2e35e62ee 100644 --- a/lib/clienterroraction.php +++ b/lib/clienterroraction.php @@ -28,11 +28,7 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR . '/lib/error.php'; +if (!defined('GNUSOCIAL')) { exit(1); } /** * Class for displaying HTTP client errors diff --git a/lib/error.php b/lib/erroraction.php similarity index 100% rename from lib/error.php rename to lib/erroraction.php diff --git a/lib/servererroraction.php b/lib/servererroraction.php index c8e3067b82..2f9a6585c2 100644 --- a/lib/servererroraction.php +++ b/lib/servererroraction.php @@ -29,11 +29,7 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR.'/lib/error.php'; +if (!defined('GNUSOCIAL')) { exit(1); } /** * Class for displaying HTTP server errors -- 2.39.5