Use QueryFailure
instead of adding a new error to make the change backwards compatible
This commit is contained in:
parent
c6a9ffcc63
commit
951109c91d
1 changed files with 2 additions and 3 deletions
|
@ -130,7 +130,6 @@ data Failure =
|
|||
| WriteConcernFailure Int String -- ^ Write concern error. It's reported only by insert, update, delete commands. Not by wire protocol.
|
||||
| DocNotFound Selection -- ^ 'fetch' found no document matching selection
|
||||
| AggregateFailure String -- ^ 'aggregate' returned an error
|
||||
| FindFailure String -- ^ 'find' returned an error
|
||||
| CompoundFailure [Failure] -- ^ When we need to aggregate several failures and report them.
|
||||
| ProtocolFailure Int String -- ^ The structure of the returned documents doesn't match what we expected
|
||||
deriving (Show, Eq, Typeable)
|
||||
|
@ -1051,7 +1050,7 @@ findCommand Query{..} = do
|
|||
]
|
||||
|
||||
getCursorFromResponse aColl response
|
||||
>>= either (liftIO . throwIO . FindFailure) return
|
||||
>>= either (liftIO . throwIO . QueryFailure (at "code" response)) return
|
||||
|
||||
where
|
||||
toInt32 :: Integral a => a -> Int32
|
||||
|
|
Loading…
Reference in a new issue