better error message on invalid portnumber
This commit is contained in:
parent
68ddceb5f1
commit
35c653160a
@ -193,7 +193,7 @@ deriveFromJSON
|
||||
instance FromJSON HaskellNet.PortNumber where
|
||||
parseJSON = withScientific "PortNumber" $ \sciNum -> case toBoundedInteger sciNum of
|
||||
Just int -> return $ fromIntegral (int :: Word16)
|
||||
Nothing -> fail "Expected whole number to denote port"
|
||||
Nothing -> fail "Expected whole number of plausible size to denote port"
|
||||
|
||||
deriveFromJSON
|
||||
defaultOptions
|
||||
|
||||
Loading…
Reference in New Issue
Block a user