From: Evan Prodromou Date: Tue, 21 Sep 2010 10:12:43 +0000 (-0400) Subject: throw a catchable exception in getUser() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ab24007f4c2f0e1290e8546893e7fa4394e367d5;p=quix0rs-gnu-social.git throw a catchable exception in getUser() --- diff --git a/scripts/commandline.inc b/scripts/commandline.inc index a29f588448..6d94a318d6 100644 --- a/scripts/commandline.inc +++ b/scripts/commandline.inc @@ -178,6 +178,10 @@ function get_option_value($opt, $alt=null) return null; } +class NoUserArgumentException extends Exception +{ +} + function getUser() { $user = null; @@ -195,8 +199,7 @@ function getUser() throw new Exception("Can't find user with nickname '$nickname'"); } } else { - show_help(); - exit(1); + throw new NoUserArgumentException("No user argument specified."); } return $user;