throw a catchable exception in getUser()

This commit is contained in:
Evan Prodromou 2010-09-21 06:12:43 -04:00
parent b1802b8720
commit ab24007f4c
1 changed files with 5 additions and 2 deletions

View File

@ -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;