mirror of
https://github.com/monoscope-tech/monoscope.git
synced 2026-11-16 10:18:01 +00:00
fix(deriving): fail an out-of-range enum int instead of decoding it to minBound
WrappedEnumInt's FromField already returned a ConversionFailed for an int with no
corresponding constructor, but its Hasql DecodeValue did
fromMaybe minBound . safeToEnum
so the same bad column silently produced the first constructor, depending only on
which driver read it. That turns a corrupt DB value into a valid-looking domain
value with no signal anywhere. Now refines through D.refine, the idiom already
used by the other DecodeValue instances in this module.
This commit is contained in:
parent
7625d7de1b
commit
5a6315f37f
1 changed files with 4 additions and 1 deletions
Loading…
Add table
Add a link
Reference in a new issue