Skip to content

Commit 50515c3

Browse files
committed
Change logic so that .meta parse failing does not error out.
1 parent 9713b1c commit 50515c3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Server.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,8 @@ private function parseLinkedMetadata(string $path)
818818
$describedByPath = $this->filesystem->getMetadata($path)['describedby'] ?? '';
819819
$describedByContents = $this->filesystem->read($describedByPath);
820820
} catch (FileNotFoundException $e) {
821-
// @CHECKME: If, for whatever reason, the file is not present after all... Do we care here?
821+
// If, for whatever reason, the file is not present after all, the resource should still be returned (or a 404)
822+
// @CHECKME: Should the upstream add a message to the header or something?
822823
return $linkMeta;
823824
}
824825

@@ -827,7 +828,9 @@ private function parseLinkedMetadata(string $path)
827828
try {
828829
$graph->parse($describedByContents, null, '/'.$describedByPath);
829830
} catch (EasyRdf_Exception $exception) {
830-
throw Exception::create(self::ERROR_CAN_NOT_PARSE_METADATA, [$path]);
831+
// If the metadata can not be parsed, the resource should still be returned (or a 404)
832+
// @CHECKME: Should the upstream add a message to the header or something?
833+
return $linkMeta;
831834
}
832835

833836
$toRdfPhp = $graph->toRdfPhp();

0 commit comments

Comments
 (0)