mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-14 06:36:46 +00:00
feat: improve error handling in election views
Update error checking in both admin and user election views. Now correctly checks the type of the response object rather than directly comparing with a string. This should provide more accurate error feedback.
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][0]) && $response[config('services.relay')][0][0] === 'ERROR') {
|
if (isset($response[config('services.relay')][0]) && $response[config('services.relay')][0]->getType() === '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][0]) && $response[config('services.relay')][0][0] === 'ERROR') {
|
if (isset($response[config('services.relay')][0]) && $response[config('services.relay')][0]->getType() === '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