diff --git a/ChangeLog.md b/ChangeLog.md index b488c94..94c3072 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +## 0.4.4 + +* Report table name and database in the UnexpectedNull case of ResultError, using the previously empty errMessage field + ## 0.4.3 * Use Data.Time.Format to parse TimeOfDay results properly (missing in https://github.com/paul-rouse/mysql-simple/pull/37). diff --git a/Database/MySQL/Simple/Result.hs b/Database/MySQL/Simple/Result.hs index 54037c4..16e117e 100644 --- a/Database/MySQL/Simple/Result.hs +++ b/Database/MySQL/Simple/Result.hs @@ -222,7 +222,12 @@ doConvert f types cvt (Just bs) | otherwise = incompatible f (typeOf (cvt undefined)) "types incompatible" doConvert f _ cvt _ = throw $ UnexpectedNull (show (fieldType f)) (show (typeOf (cvt undefined))) - (B8.unpack (fieldName f)) "" + (B8.unpack (fieldName f)) + ("unexpected null in table " + ++ B8.unpack (fieldTable f) + ++ " of database " + ++ B8.unpack (fieldDB f) + ) incompatible :: Field -> TypeRep -> String -> a incompatible f r = throw . Incompatible (show (fieldType f)) diff --git a/mysql-simple.cabal b/mysql-simple.cabal index ef7ed91..8cfdcd3 100644 --- a/mysql-simple.cabal +++ b/mysql-simple.cabal @@ -1,5 +1,5 @@ name: mysql-simple -version: 0.4.3 +version: 0.4.4 homepage: https://github.com/paul-rouse/mysql-simple bug-reports: https://github.com/paul-rouse/mysql-simple/issues synopsis: A mid-level MySQL client library.