mirror of
https://github.com/elyby/accounts.git
synced 2024-12-27 07:30:18 +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);
|
|
}
|
|
|
|
}
|