]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better error checking in shownotice
authorEvan Prodromou <evan@prodromou.name>
Fri, 11 Jul 2008 17:13:45 +0000 (13:13 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 11 Jul 2008 17:13:45 +0000 (13:13 -0400)
darcs-hash:20080711171345-84dde-790e24f1d31a716cc52857229087469cd84ad65e.gz

actions/shownotice.php

index 4803f5fdfc1b673be22c732f11647d2b114f0cf8..5b125c25b48c6f2e335654e621271a9b97226409 100644 (file)
@@ -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.');
-       }
 }