Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Yii Framework 2 Change Log
- Bug #21094: Log a warning instead of silently ignoring `$isolationLevel` when `yii\db\Transaction::begin()` is called for a nested transaction (terabytesoftw)
- Bug #21086: Allow integer and string keys in the `yii\base\Model::rules()` return annotation (terabytesoftw)
- Bug #21115: Fix PHPStan 2.3.0 `parameterByRef.type` error in `yii\db\QueryBuilder::getTableUniqueColumnNames()` (theluckystrike)
- Enh #20681: Add `yii\base\ErrorHandler::fallbackExceptionMessage()` to customize the message shown by `handleFallbackExceptionMessage()` when `YII_DEBUG` is disabled (ZhandosKz, terabytesoftw)

2.0.55 May 09, 2026
-------------------
Expand Down
18 changes: 17 additions & 1 deletion framework/base/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ protected function handleFallbackExceptionMessage($exception, $previousException
}
$msg .= "\n\$_SERVER = " . VarDumper::export($_SERVER);
} else {
echo 'An internal server error occurred.';
echo $this->fallbackExceptionMessage($exception, $previousException);
}
error_log($msg);
if (defined('HHVM_VERSION')) {
Expand All @@ -197,6 +197,22 @@ protected function handleFallbackExceptionMessage($exception, $previousException
exit(1);
}

/**
* Returns the message displayed when an exception is thrown while handling another exception
* and `YII_DEBUG` is disabled.
*
* @param \Throwable $exception Exception that was thrown during main exception processing.
* @param \Throwable $previousException Main exception processed in [[handleException()]].
*
* @return string the message to be displayed.
*
* @since 2.0.56
*/
protected function fallbackExceptionMessage($exception, $previousException)
{
return 'An internal server error occurred.';
}

/**
* Handles HHVM execution errors such as warnings and notices.
*
Expand Down
Loading