git.iko.soy/typeable/postgresql-simple
on master help sign in
Merge pull request #184 from bgamari/master
999d70fLeon P Smith
src/Database/PostgreSQL/Simple/Copy.hs+3−1
@@ -224,7 +224,9 @@ getCopyCommandTag funcName pqconn = do
224 consumeResults pqconn
224 consumeResults pqconn
225 let rowCount = P.string "COPY " *> (P.decimal <* P.endOfInput)
225 let rowCount = P.string "COPY " *> (P.decimal <* P.endOfInput)
226 case P.parseOnly rowCount cmdStat of
226 case P.parseOnly rowCount cmdStat of
227+ Left _ -> do mmsg <- PQ.errorMessage pqconn
227− Left _ -> fail errCmdStatusFmt
228+ fail $ errCmdStatusFmt
229+ ++ maybe "" (\msg -> "\nConnection error: "++B.unpack msg) mmsg
228 Right n -> return $! n
230 Right n -> return $! n
229 where
231 where
230 errCmdStatus = B.unpack funcName ++ ": failed to fetch command status"
232 errCmdStatus = B.unpack funcName ++ ": failed to fetch command status"