public function getExceptionName($exception)
    {
        if ($exception instanceof \yii\exceptions\Exception || $exception instanceof \yii\exceptions\InvalidCallException ||
            $exception instanceof \yii\exceptions\InvalidArgumentException ||
            $exception instanceof \yii\exceptions\UnknownMethodException) {
            return $exception->getName();
        }

        return null;
    }