Commit 132e8742 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Proper error message when election is closed

parent c8108e64
......@@ -346,6 +346,7 @@ let do_cast election uuid () =
with
| Serialization e -> return (`Malformed e)
| ProofCheck -> return `Invalid
| ElectionClosed -> return `Closed
in
Eliom_reference.unset Services.ballot >>
Templates.do_cast_ballot ~election:X.data ~result
......
......@@ -268,6 +268,7 @@ let do_cast_ballot ~election ~result =
| `Valid hash -> pcdata (" has been accepted, its hash is " ^ hash ^ ".")
| `Invalid -> pcdata " is invalid!"
| `Malformed e -> Printf.ksprintf pcdata " is malformed! (%s)" (Printexc.to_string e)
| `Closed -> pcdata " cannot be accepted because the election is closed!"
);
];
div [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment