summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-11 13:13:45 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-11 13:13:45 -0400
commitad410c0c616035fa1ce7372a3ceca25d6a9010bb (patch)
tree2c01f0a2efd3a7aea1da5a20a9ad525afce1bf97 /actions
parent335d5f2e89261cdb74c12ddb9e46d549200d3364 (diff)
better error checking in shownotice
darcs-hash:20080711171345-84dde-790e24f1d31a716cc52857229087469cd84ad65e.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/shownotice.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/actions/shownotice.php b/actions/shownotice.php
index 4803f5fdf..5b125c25b 100644
--- a/actions/shownotice.php
+++ b/actions/shownotice.php
@@ -29,13 +29,15 @@ class ShownoticeAction extends StreamAction {
$notice = Notice::staticGet($id);
if (!$notice) {
- $this->no_such_notice();
+ $this->client_error(_t('No such notice.'), 404);
+ return;
}
$profile = $notice->getProfile();
if (!$profile) {
- $this->no_such_notice();
+ $this->server_error(_t('Notice has no profile'), 500);
+ return;
}
# Looks like we're good; show the header
@@ -58,8 +60,4 @@ class ShownoticeAction extends StreamAction {
common_notice_form();
}
}
-
- function no_such_notice() {
- common_user_error('No such notice.');
- }
}