Добавлен кастомный ErrorHandler для форматирования ошибок authserver'а в соответствии с ожиданиями лаунчера

This commit is contained in:
ErickSkrauch
2016-08-31 13:32:14 +03:00
parent 9c658f5bd9
commit 66e266692c
3 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<?php
namespace api\components;
use api\modules\authserver\exceptions\AuthserverException;
class ErrorHandler extends \yii\web\ErrorHandler {
public function convertExceptionToArray($exception) {
if ($exception instanceof AuthserverException) {
return [
'error' => $this->getExceptionName($exception),
'errorMessage' => $exception->getMessage(),
];
}
return parent::convertExceptionToArray($exception);
}
}