public function getCauseMessage()
    {
        $causes  = [];
        $current = [
            'class'   => get_class($this),
            'message' => $this->getMessage(),
            'code'    => $this->getCode(),
            'file'    => $this->getFile(),
            'line'    => $this->getLine()
        ];

        $causes[] = $current;
        $previous = $this->getPrevious();

        while ($previous !== null) {
            if ($previous instanceof Exception) {
                $prevCauses = $previous->getCauseMessage();

                foreach ($prevCauses as $cause) {
                    $causes[] = $cause;
                }
            } elseif ($previous instanceof PhpException) {
                $causes[] = [
                    'class'   => get_class($previous),
                    'message' => $previous->getMessage(),
                    'code'    => $previous->getCode(),
                    'file'    => $previous->getFile(),
                    'line'    => $previous->getLine()
                ];
            }

            $previous = $previous->getPrevious();
        }

        return $causes;
    }