Do not swallow previous exception (#1778)

The previous exception will be included when loading the content as DOM Document fails. This makes debugging the reason behind the failure much easier.
This commit is contained in:
Jasper Zonneveld 2021-01-29 15:57:56 +01:00 committed by GitHub
parent 65837daa98
commit 97aa78fc9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -650,7 +650,7 @@ class Html extends BaseReader
$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 @@ class Html extends BaseReader
$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());