protected function getClassesHierarchy(\Exception $e)
    {
        $exceptionClass = get_class($e);
        $exceptionClassesHierarchy = array_values(class_parents($exceptionClass));
        array_unshift($exceptionClassesHierarchy, $exceptionClass);
        $exceptionClassesHierarchy = array_flip($exceptionClassesHierarchy);
        return $exceptionClassesHierarchy;
    }