Commit 865a94f3 by Qiang Xue

Fixes #4739: Better display of exceptions when the response format is set as "raw" format

parent 84953252
...@@ -32,6 +32,7 @@ Yii Framework 2 Change Log ...@@ -32,6 +32,7 @@ Yii Framework 2 Change Log
- Enh #4181: Added `yii\bootstrap\Modal::$headerOptions` and `yii\bootstrap\Modal::$footerOptions` (tuxoff, samdark) - Enh #4181: Added `yii\bootstrap\Modal::$headerOptions` and `yii\bootstrap\Modal::$footerOptions` (tuxoff, samdark)
- Enh #4263: Added migration and SQL schema files for `yii\log\DbTarget` (samdark) - Enh #4263: Added migration and SQL schema files for `yii\log\DbTarget` (samdark)
- Enh #4457: Added support for using noscript for css files registered through asset bundles and Html helper (samdark) - Enh #4457: Added support for using noscript for css files registered through asset bundles and Html helper (samdark)
- Enh #4739: Better display of exceptions when the response format is set as "raw" format (qiangxue)
- Enh #5223: Query builder now supports selecting sub-queries as columns (qiangxue) - Enh #5223: Query builder now supports selecting sub-queries as columns (qiangxue)
- Enh #5367: Added `yii\grid\DataColumn::encodeLabel` (SDKiller) - Enh #5367: Added `yii\grid\DataColumn::encodeLabel` (SDKiller)
- Enh #5587: `json_encode` is now used with `JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE` where it makes sense, also - Enh #5587: `json_encode` is now used with `JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE` where it makes sense, also
......
...@@ -98,6 +98,8 @@ class ErrorHandler extends \yii\base\ErrorHandler ...@@ -98,6 +98,8 @@ class ErrorHandler extends \yii\base\ErrorHandler
'exception' => $exception, 'exception' => $exception,
]); ]);
} }
} elseif ($response->format === Response::FORMAT_RAW) {
$response->data = $exception;
} else { } else {
$response->data = $this->convertExceptionToArray($exception); $response->data = $this->convertExceptionToArray($exception);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment