Skip to content

Commit 392b6b1

Browse files
committed
return 404 when the storage is not found
1 parent e329bb2 commit 392b6b1

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/Routes/SolidStorage.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ public static function respondToStorage() {
1616
$requestFactory = new ServerRequestFactory();
1717
$rawRequest = $requestFactory->fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);
1818

19-
StorageServer::initializeStorage();
20-
$filesystem = StorageServer::getFileSystem();
19+
try {
20+
StorageServer::initializeStorage();
21+
$filesystem = StorageServer::getFileSystem();
22+
} catch (\Exception $e) {
23+
$response = new Response();
24+
$response = $response->withStatus(404, "Not found");
25+
StorageServer::respond($response);
26+
exit();
27+
}
2128

2229
$resourceServer = new ResourceServer($filesystem, new Response(), null);
2330
$solidNotifications = new SolidNotifications();

0 commit comments

Comments
 (0)