Skip to content

Commit

Permalink
Catch unhandled InvalidArgumentException
Browse files Browse the repository at this point in the history
  • Loading branch information
carlbennett committed Aug 23, 2019
1 parent cf3e95b commit 4912314
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/controllers/User/Activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

namespace BNETDocs\Controllers\User;

use \BNETDocs\Models\User\Activate as UserActivateModel;
use \CarlBennett\MVC\Libraries\Common;
use \CarlBennett\MVC\Libraries\Controller;
use \CarlBennett\MVC\Libraries\Router;
use \CarlBennett\MVC\Libraries\View;

use \BNETDocs\Libraries\EventTypes;
use \BNETDocs\Libraries\Exceptions\UserNotFoundException;
use \BNETDocs\Libraries\Logger;
use \BNETDocs\Libraries\User;

use \CarlBennett\MVC\Libraries\Common;
use \CarlBennett\MVC\Libraries\Controller;
use \CarlBennett\MVC\Libraries\Router;
use \CarlBennett\MVC\Libraries\View;
use \BNETDocs\Models\User\Activate as UserActivateModel;

use \InvalidArgumentException;

class Activate extends Controller {

Expand All @@ -34,6 +36,8 @@ public function &run( Router &$router, View &$view, array &$args ) {
$model->user = new User( $model->user_id );
} catch ( UserNotFoundException $ex ) {
$model->user = null;
} catch ( InvalidArgumentException $ex ) {
$model->user = null;
}

if ( $model->user ) {
Expand Down

0 comments on commit 4912314

Please sign in to comment.