Skip to content

Commit

Permalink
#18 Throw fatal error only if can't find main document part
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy-1 committed Nov 20, 2020
1 parent ce0fe50 commit e8fa3d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/docx2jats/DOCXArchive.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ private function getRealFileDocumentPath(string $defaultPath, string $contentTyp
try {
$this->findDocumentByPath($path);
} catch (\Exception $e) {
trigger_error($e->getMessage(), E_USER_ERROR);
if ($defaultPath === self::CONTENT_TYPE_DOCUMENT_MAIN) {
trigger_error($e->getMessage(), E_USER_ERROR);
} else {
trigger_error($e->getMessage(), E_USER_NOTICE);
}
}

return $path;
Expand Down

0 comments on commit e8fa3d9

Please sign in to comment.