FIX: TUI SHOW ERROR

This commit is contained in:
rubenpirreram
2026-05-04 15:21:33 +02:00
parent 5d49199e4d
commit 5418d70cf8
3 changed files with 4 additions and 4 deletions
@@ -133,7 +133,7 @@ public class ClientLauncherTUI {
System.out.println("Insert the required position:"); System.out.println("Insert the required position:");
pos = scanner.nextInt(); pos = scanner.nextInt();
} catch (Exception e) { } catch (Exception e) {
System.out.println("ERROR: Invalid input(expected number)"); view.showError("ERROR: Invalid input(expected number)");
return; return;
} }
} }
@@ -156,7 +156,7 @@ public class ClientLauncherTUI {
} }
else else
{ {
System.out.println("ERROR: Invalid input(action not valid)"); view.showError("ERROR: Invalid input(action not valid)");
} }
} }
} }
@@ -53,7 +53,7 @@ public class ClientCallbackImpl extends UnicastRemoteObject implements IClientCa
@Override @Override
public void onAction(NetworkEvent event) throws RemoteException { public void onAction(NetworkEvent event) throws RemoteException {
if(event.getIsError()) { if(event.getIsError()) {
System.out.println(event.toString()); clientController.view.showError(event.toString());
} else { } else {
event.apply(clientController.localController); event.apply(clientController.localController);
clientController.view.render(); clientController.view.render();
@@ -97,7 +97,7 @@ public class TCPClient implements IClient {
if (read instanceof NetworkEvent event) { //TODO: avoid instanceof if (read instanceof NetworkEvent event) { //TODO: avoid instanceof
if (event.getIsError()) { if (event.getIsError()) {
System.out.println(event); controller.view.showError(event.toString());
} else { } else {
event.apply(controller.localController); event.apply(controller.localController);
controller.view.render(); controller.view.render();