We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 80e2e95 + 5ce5d2e commit 999d70fCopy full SHA for 999d70f
1 file changed
src/Database/PostgreSQL/Simple/Copy.hs
@@ -224,7 +224,9 @@ getCopyCommandTag funcName pqconn = do
224
consumeResults pqconn
225
let rowCount = P.string "COPY " *> (P.decimal <* P.endOfInput)
226
case P.parseOnly rowCount cmdStat of
227
- Left _ -> fail errCmdStatusFmt
+ Left _ -> do mmsg <- PQ.errorMessage pqconn
228
+ fail $ errCmdStatusFmt
229
+ ++ maybe "" (\msg -> "\nConnection error: "++B.unpack msg) mmsg
230
Right n -> return $! n
231
where
232
errCmdStatus = B.unpack funcName ++ ": failed to fetch command status"
0 commit comments