Skip to content

Commit 7f28ab3

Browse files
committed
Change Server to convert WebSocket exceptions to project specific one.
1 parent 6f2b6bf commit 7f28ab3

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/Server.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,17 @@ private function sendWebsocketUpdate($path)
411411
'Sec-WebSocket-Protocol' => 'solid-0.1'
412412
)
413413
));
414-
$client->send("pub $baseUrl$path\n");
415414

416-
while ($path !== "/") {
417-
$path = $this->parentPath($path);
418-
$client->send("pub $baseUrl$path\n");
419-
}
415+
try {
416+
$client->send("pub $baseUrl$path\n");
417+
418+
while ($path !== "/") {
419+
$path = $this->parentPath($path);
420+
$client->send("pub $baseUrl$path\n");
421+
}
422+
} catch (\WebSocket\Exception $exception) {
423+
throw new Exception('Could not write to pub-sup server', 502, $exception);
424+
}
420425
}
421426

422427
private function handleDeleteRequest(Response $response, string $path, $contents): Response

0 commit comments

Comments
 (0)