From 3491bb2df7f7c823b68bcde9359ad5d43146dfa7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 12 Jun 2008 15:39:45 -0400 Subject: catch errors in debug log darcs-hash:20080612193945-84dde-2c368ba1273814401f741ef79333c0cd8a43f90d.gz --- lib/action.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib') diff --git a/lib/action.php b/lib/action.php index 50370c09f..b2374b1d2 100644 --- a/lib/action.php +++ b/lib/action.php @@ -60,4 +60,16 @@ class Action { // lawsuit return $def; } } + + function server_error($msg, $code=500) { + $action = $this->trimmed('action'); + common_debug("Server error '$code' on '$action': $msg", __FILE__); + common_server_error($msg, $code); + } + + function client_error($msg, $code=500) { + $action = $this->trimmed('action'); + common_debug("User error '$code' on '$action': $msg", __FILE__); + common_user_error($msg, $code); + } } -- cgit v1.2.3-54-g00ecf