From aa06d760b375c0cc9bbc693bf4bd412e9fda8f50 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 9 Feb 2009 07:15:52 -0500 Subject: Index and Action use Exceptions Main Web entry point accepts exceptions, and main code in Action throws them. --- lib/action.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/action.php b/lib/action.php index c4172ada1..9fbabb4fc 100644 --- a/lib/action.php +++ b/lib/action.php @@ -789,11 +789,12 @@ class Action extends HTMLOutputter // lawsuit * * @return nothing */ + function serverError($msg, $code=500) { $action = $this->trimmed('action'); common_debug("Server error '$code' on '$action': $msg", __FILE__); - common_server_error($msg, $code); + throw new ServerException($msg, $code); } /** @@ -804,11 +805,12 @@ class Action extends HTMLOutputter // lawsuit * * @return nothing */ + function clientError($msg, $code=400) { $action = $this->trimmed('action'); common_debug("User error '$code' on '$action': $msg", __FILE__); - common_user_error($msg, $code); + throw new ClientException($msg, $code); } /** -- cgit v1.2.3-54-g00ecf