Prevent users from setting JOBSERIAL and from setting variables with invalid names.
[whenjobs.git] / tools / whenjobs.ml
index 0810649..60795ba 100644 (file)
@@ -296,7 +296,13 @@ and set_variable name value typ =
       ) in
 
   let client = start_client () in
-  Whenproto_clnt.When.V1.set_variable client (name, value);
+  (match Whenproto_clnt.When.V1.set_variable client (name, value) with
+  | `ok -> ()
+  | `error msg ->
+    eprintf "whenjobs: set: %s\n" msg;
+    suggest_check_server_logs ();
+    exit 1
+  );
   stop_client client
 
 and get_variable name =