diff options
author | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2019-11-20 14:20:39 +0100 |
---|---|---|
committer | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2019-11-20 14:20:39 +0100 |
commit | 4693b0a6ac7bcb408eef3aac67d1052082ce9ae9 (patch) | |
tree | 199d916171bacab012753f944a1bc265958d0688 /src/main/java/pl/edu/mimuw/cloudatlas | |
parent | 3b82c72f0de30db176df3a1bc5323e0fd9bb0a03 (diff) |
Add exception message to query submission
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas')
-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"; } |