summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-06-12 15:39:45 -0400
committerEvan Prodromou <evan@prodromou.name>2008-06-12 15:39:45 -0400
commit3491bb2df7f7c823b68bcde9359ad5d43146dfa7 (patch)
treea62f1b24ab899f51f8ba1ce098cbcfc711aed14a /lib/action.php
parent4449ff2051ce7ec09ca8b4371890767cd5ece88f (diff)
catch errors in debug log
darcs-hash:20080612193945-84dde-2c368ba1273814401f741ef79333c0cd8a43f90d.gz
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php12
1 files changed, 12 insertions, 0 deletions
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);
+ }
}