m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu
diff options
context:
space:
mode:
authorMagdalena Grodzińska <mag.grodzinska@gmail.com>2019-11-20 14:20:39 +0100
committerMagdalena Grodzińska <mag.grodzinska@gmail.com>2019-11-20 14:20:39 +0100
commit4693b0a6ac7bcb408eef3aac67d1052082ce9ae9 (patch)
tree199d916171bacab012753f944a1bc265958d0688 /src/main/java/pl/edu
parent3b82c72f0de30db176df3a1bc5323e0fd9bb0a03 (diff)
Add exception message to query submission
Diffstat (limited to 'src/main/java/pl/edu')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java14
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";
}