Skip to content

Commit

Permalink
Report table name and database in the UnexpectedNull case of ResultError
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-rouse committed Oct 21, 2017
1 parent 9e3147b commit a0f5721
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions 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).
Expand Down
7 changes: 6 additions & 1 deletion Database/MySQL/Simple/Result.hs
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion 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.
Expand Down

0 comments on commit a0f5721

Please sign in to comment.