Skip to content

Commit 8ec469b

Browse files
committed
fix: render all user exceptions not just http exceptions
1 parent 338ab4d commit 8ec469b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Codeception/Lib/Connector/Yii2.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
use Yii;
1212
use yii\base\ExitException;
1313
use yii\base\Security;
14+
use yii\base\UserException;
1415
use yii\mail\MessageInterface;
1516
use yii\web\Application;
1617
use yii\web\ErrorHandler;
17-
use yii\web\HttpException;
1818
use yii\web\Request;
1919
use yii\web\Response as YiiResponse;
2020

@@ -372,7 +372,7 @@ public function doRequest(object $request)
372372
$app->trigger($app::EVENT_AFTER_REQUEST);
373373
$response->send();
374374
} catch (\Exception $e) {
375-
if ($e instanceof HttpException) {
375+
if ($e instanceof UserException) {
376376
// Don't discard output and pass exception handling to Yii to be able
377377
// to expect error response codes in tests.
378378
$app->errorHandler->discardExistingOutput = false;

0 commit comments

Comments
 (0)