Skip to content

Commit

Permalink
Added concrete http exception classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangxue committed Nov 30, 2013
1 parent 5836dc9 commit 6051763
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Yii;
use yii\base\Application;
use yii\web\View;
use yii\web\HttpException;
use yii\web\AccessDeniedHttpException;

/**
* The Yii Debug Module provides the debug toolbar and debugger
Expand Down Expand Up @@ -79,7 +79,7 @@ public function beforeAction($action)
} elseif ($action->id === 'toolbar') {
return false;
} else {
throw new HttpException(403, 'You are not allowed to access this page.');
throw new AccessDeniedHttpException('You are not allowed to access this page.');
}
}

Expand Down
4 changes: 2 additions & 2 deletions controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use Yii;
use yii\web\Controller;
use yii\web\HttpException;
use yii\web\NotFoundHttpException;

/**
* @author Qiang Xue <qiang.xue@gmail.com>
Expand Down Expand Up @@ -99,7 +99,7 @@ protected function loadData($tag)
}
$this->summary = $data['summary'];
} else {
throw new HttpException(404, "Unable to find debug data tagged with '$tag'.");
throw new NotFoundHttpException("Unable to find debug data tagged with '$tag'.");
}
}
}

0 comments on commit 6051763

Please sign in to comment.