@@ -66,10 +66,10 @@ instance Exception ConstraintViolation
6666-- | Tries to convert 'SqlError' to 'ConstrainViolation', checks sqlState and
6767-- succeedes only if able to parse sqlErrorMsg.
6868--
69- -- > createUser = catchJust constraintViolation catcher $ execute conn ...
69+ -- > createUser = handleJust constraintViolation handler $ execute conn ...
7070-- > where
71- -- > catcher UniqueViolation "user_login_key" = ...
72- -- > catcher _ = ...
71+ -- > handler ( UniqueViolation "user_login_key") = ...
72+ -- > handler _ = ...
7373constraintViolation :: SqlError -> Maybe ConstraintViolation
7474constraintViolation e =
7575 case sqlState e of
@@ -84,16 +84,16 @@ constraintViolation e =
8484
8585-- | Like constraintViolation, but also packs original SqlError.
8686--
87- -- > createUser = catchJust constraintViolationE catcher $ execute conn ...
87+ -- > createUser = handleJust constraintViolationE handler $ execute conn ...
8888-- > where
89- -- > catcher (_, UniqueViolation "user_login_key") = ...
90- -- > catcher (e, _) = throwIO e
89+ -- > handler (_, UniqueViolation "user_login_key") = ...
90+ -- > handler (e, _) = throwIO e
9191--
9292constraintViolationE :: SqlError -> Maybe (SqlError , ConstraintViolation )
9393constraintViolationE e = fmap ((,) e) $ constraintViolation e
9494
9595-- | Catches SqlError, tries to convert to ConstraintViolation, re-throws
96- -- on fail. Provides alternative interface to catchJust
96+ -- on fail. Provides alternative interface to 'E.handleJust'
9797--
9898-- > createUser = catchViolation catcher $ execute conn ...
9999-- > where
0 commit comments