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:
parent
65837daa98
commit
97aa78fc9a
|
|
@ -650,7 +650,7 @@ class Html extends BaseReader
|
||||||
$loaded = false;
|
$loaded = false;
|
||||||
}
|
}
|
||||||
if ($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);
|
return $this->loadDocument($dom, $spreadsheet);
|
||||||
|
|
@ -672,7 +672,7 @@ class Html extends BaseReader
|
||||||
$loaded = false;
|
$loaded = false;
|
||||||
}
|
}
|
||||||
if ($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());
|
return $this->loadDocument($dom, $spreadsheet ?? new Spreadsheet());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue