New error message for signature algorithms accepting an unique nb of chars.

This commit is contained in:
Philippe Pittoli 2024-11-09 20:00:18 +01:00
parent dc793637ae
commit 4e983506f9

View File

@ -1,7 +1,7 @@
-- | This module provides functions to display errors in a fancy way.
module App.DisplayErrors where
import Prelude (show, ($), (<>))
import Prelude (show, ($), (<>), (==))
-- import Data.Foldable as Foldable
import Data.Maybe (Maybe(..), maybe)
@ -60,7 +60,9 @@ error_to_paragraph v = Bulma.error_message (Bulma.p $ show_error_title v)
show_error_key_sizes :: forall w i. Int -> Int -> HH.HTML w i
show_error_key_sizes min max
= Bulma.p $ "Chosen signature algorithm only accepts public key input between "
= if min == max
then Bulma.p $ "Chosen signature algorithm only accepts public key input of " <> show min <> " characters."
else Bulma.p $ "Chosen signature algorithm only accepts public key input between "
<> show min <> " and " <> show max <> " characters."
-- | `show_error_title` provide a simple title string to display to the user in case of an error with an entry.