diff --git a/src/PhpSpreadsheet/Reader/Html.php b/src/PhpSpreadsheet/Reader/Html.php index 73f4591e7f..e11390155b 100644 --- a/src/PhpSpreadsheet/Reader/Html.php +++ b/src/PhpSpreadsheet/Reader/Html.php @@ -650,7 +650,7 @@ public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet) $loaded = false; } if ($loaded === false) { - throw new Exception('Failed to load ' . $pFilename . ' as a DOM Document'); + throw new Exception('Failed to load ' . $pFilename . ' as a DOM Document', 0, $e ?? null); } return $this->loadDocument($dom, $spreadsheet); @@ -672,7 +672,7 @@ public function loadFromString($content, ?Spreadsheet $spreadsheet = null): Spre $loaded = false; } if ($loaded === false) { - throw new Exception('Failed to load content as a DOM Document'); + throw new Exception('Failed to load content as a DOM Document', 0, $e ?? null); } return $this->loadDocument($dom, $spreadsheet ?? new Spreadsheet());