Merge pull request 'added error handling when requesting to join non existing room' (#41) from bugfix/unhandled-error-when-trying-to-join-non-existing-room into develop
All checks were successful
default-pipeline default-pipeline #187
All checks were successful
default-pipeline default-pipeline #187
Reviewed-on: https://gitea.e5tv.hu/esoko/mapguesser/pulls/41 Reviewed-by: Pőcze Bence <bence@pocze.ch>
This commit is contained in:
commit
7f8c1eb291
@ -410,6 +410,10 @@
|
|||||||
MapGuesser.showModalWithContent('Error', 'This game is already started, you cannot join.');
|
MapGuesser.showModalWithContent('Error', 'This game is already started, you cannot join.');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'game_not_found':
|
||||||
|
MapGuesser.showModalWithContent('Error', 'The game room was not found by this ID. Please check the link.');
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
MapGuesser.showModalWithContent('Error', 'Error code: \'' + error + '\'');
|
MapGuesser.showModalWithContent('Error', 'Error code: \'' + error + '\'');
|
||||||
break
|
break
|
||||||
|
@ -114,6 +114,11 @@ class GameController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$room = $this->multiRoomRepository->getByRoomId($roomId);
|
$room = $this->multiRoomRepository->getByRoomId($roomId);
|
||||||
|
|
||||||
|
if(!isset($room)) {
|
||||||
|
return new JsonContent(['error' => 'game_not_found']);
|
||||||
|
}
|
||||||
|
|
||||||
$state = $room->getStateArray();
|
$state = $room->getStateArray();
|
||||||
$map = $this->mapRepository->getById($state['mapId']);
|
$map = $this->mapRepository->getById($state['mapId']);
|
||||||
$token = $this->getMultiToken($roomId);
|
$token = $this->getMultiToken($roomId);
|
||||||
|
Loading…
Reference in New Issue
Block a user