Skip to content

Commit

Permalink
Merge pull request #1231 from NatLibFi/issue1170-rest-fatal-error-voc…
Browse files Browse the repository at this point in the history
…ab-id-not-found

Avoid uncaught fatal errors in REST API if vocabulary ID not found
  • Loading branch information
osma committed Nov 2, 2021
2 parents 5cf55f0 + 09fa432 commit d12c2d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
$vocab = $parts[1];
try {
$request->setVocab($parts[1]);
} catch (Exception $e) {
} catch (Exception | ValueError $e) {
header("HTTP/1.0 404 Not Found");
header("Content-type: text/plain; charset=utf-8");
echo ("404 Not Found : Vocabulary id '$parts[1]' not found.");
Expand Down

0 comments on commit d12c2d3

Please sign in to comment.