diff options
Diffstat (limited to 'src/main/java/pl/edu')
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java index ea39a3d..bdc71df 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -47,14 +47,26 @@ public class ClientController { @PostMapping("/query") public String submitQuery(@ModelAttribute Query queryObject, Model model) { + boolean success = true; + try { this.api.installQuery(queryObject.getName(), queryObject.getValue()); } catch (Exception e) { + success = false; System.err.println("Client exception:"); e.printStackTrace(); } - model.addAttribute("homeMessage", "Query submitted successfully"); + if (success) { + model.addAttribute( + "homeMessage", + "Query submitted successfully"); + } else { + model.addAttribute( + "homeMessage", + "Query submission failed with a remote exception"); + } + return "home"; } |