fixed the bounded integer error message

This commit is contained in:
Tom Sydney Kerckhove 2021-11-06 02:16:23 +01:00
parent a6134dcdb9
commit ccd5a05ef7
3 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
Error in $: Number too big: 1.0e10000
Error in $: Number did not fit into bounded integer: 1.0e10000

View File

@ -1 +1 @@
Error in $: Number too big: -3.0
Error in $: Number did not fit into bounded integer: -3.0

View File

@ -650,7 +650,7 @@ boundedIntegerCodec :: (Integral i, Bounded i) => JSONCodec i
boundedIntegerCodec = bimapCodec go fromIntegral $ NumberCodec Nothing
where
go s = case Scientific.toBoundedInteger s of
Nothing -> Left $ "Number too big: " <> show s
Nothing -> Left $ "Number did not fit into bounded integer: " <> show s
Just i -> Right i
-- | A codec for a literal piece of 'Text'.