mirror of
https://github.com/elyby/accounts.git
synced 2024-11-09 23:12:20 +05:30
20 lines
500 B
PHP
20 lines
500 B
PHP
|
<?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);
|
||
|
}
|
||
|
|
||
|
}
|