static function exportException(?\Throwable $e) {
        if($e === null) {
            return null;
        }
        
        $handler = \CharlotteDunois\Phoebe\ExceptionHandler::getInstance();
        if($handler->handlesException($e)) {
            return $handler->exportException($e);
        }
        
        $trace = array();
        foreach($e->getTrace() as $entry) {
            if(isset($entry['args'])) {
                foreach($entry['args'] as $key => $arg) {
                    $entry['args'][$key] = static::exportTraceArgs($arg);
                }
            } else {
                $entry['args'] = array();
            }
            
            $trace[] = $entry;
        }
        
        return array(
            'class' => \get_class($e),
            'message' => $e->getMessage(),
            'code' => $e->getCode(),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
            'trace' => $trace,
            'previous' => static::exportException($e->getPrevious())
        );
    }