mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-14 06:36:46 +00:00
feat: add additional error check in association election views
The association election admin and user views now perform an additional check to ensure the relay service is responding correctly. This should prevent unexpected crashes when the service is unavailable or returning errors.
This commit is contained in:
@@ -95,7 +95,7 @@ $loadEvents = function () {
|
|||||||
$response = $request->send();
|
$response = $request->send();
|
||||||
|
|
||||||
// Check for errors in the response
|
// Check for errors in the response
|
||||||
if (isset($response[config('services.relay')][0]) && $response[config('services.relay')][0]->getType() === 'ERROR') {
|
if (isset($response[config('services.relay')][0]) && isset($response[config('services.relay')][0][0]) && $response[config('services.relay')][0][0] === 'ERROR') {
|
||||||
abort(500, 'Kann keine Events laden. Nostr Relay antwortet nicht.');
|
abort(500, 'Kann keine Events laden. Nostr Relay antwortet nicht.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ $loadEvents = function () {
|
|||||||
$response = $request->send();
|
$response = $request->send();
|
||||||
|
|
||||||
// Check for errors in the response
|
// Check for errors in the response
|
||||||
if (isset($response[config('services.relay')][0]) && $response[config('services.relay')][0]->getType() === 'ERROR') {
|
if (isset($response[config('services.relay')][0]) && isset($response[config('services.relay')][0][0]) && $response[config('services.relay')][0][0] === 'ERROR') {
|
||||||
abort(500, 'Kann keine Events laden. Nostr Relay antwortet nicht.');
|
abort(500, 'Kann keine Events laden. Nostr Relay antwortet nicht.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user