commit 5f162a95bc1792428b5125ef3551f1ec10f839e5 parent 1b8293f93e37c8a2a17f40b45b77b640e35675fe Author: Daniel Barlow <dan@telent.net> Date: Sun, 3 Nov 2024 18:47:45 +0000 improve error message (it's still rubbish though) Diffstat:
| M | app/Main.hs | | | 20 | +++++++++++--------- |
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/app/Main.hs b/app/Main.hs @@ -104,15 +104,17 @@ postUploadR = do defaultLayout [whamlet|<p>#{List.length points} points - thanks!|] Left e -> defaultLayout - [whamlet|<p>error ] - FormMissing -> - traceShow "missing" $ - defaultLayout [whamlet|<p>missing|] - FormFailure x -> - traceShow x $ - defaultLayout - [whamlet| - <p>Nope, sorry + [whamlet|<p>parse error ] + FormMissing -> + defaultLayout [whamlet|<p>FormMissing (?)|] + FormFailure errors -> + defaultLayout + [whamlet| + <h1>Error uploading + <ul> + $forall err <- errors + <li>#{err} + |] main :: IO ()