Skip to content
Browse files

use HDBC's throwSqlError instead of throwDyn.

--HG--
extra : convert_revision : 10a74ecc4ddd20cd6e09083924f875eafcccb46b
  • Loading branch information...
1 parent ba00739 commit 5ab2207dfde3ba967e1ad128fbe11f3fe05eb75a @waterson waterson committed Mar 2, 2009
Showing with 6 additions and 5 deletions.
  1. +4 −3 Database/HDBC/MySQL/Connection.hsc
  2. +2 −2 HDBC-mysql.cabal
View
7 Database/HDBC/MySQL/Connection.hsc
@@ -17,6 +17,7 @@ import Data.Time.Clock.POSIX
import qualified Database.HDBC.Types as Types
import Database.HDBC.ColTypes as ColTypes
+import Database.HDBC (throwSqlError)
#include <mysql.h>
@@ -652,7 +653,7 @@ doDescribeTable mysql__ table = do
nullable = Just $ nullAllowed == "YES"
in (colname, ColTypes.SqlColDesc sqlTypeId Nothing Nothing Nothing nullable)
- fromRow _ = throwDyn $ Types.SqlError "" 0 "DESCRIBE failed"
+ fromRow _ = error "DESCRIBE failed"
-- XXX this is likely to be incomplete.
typeIdOfString :: String -> ColTypes.SqlTypeId
@@ -689,14 +690,14 @@ statementError :: Ptr MYSQL_STMT -> IO a
statementError stmt_ = do
errno <- mysql_stmt_errno stmt_
msg <- peekCString =<< mysql_stmt_error stmt_
- throwDyn $ Types.SqlError "" (fromIntegral errno) msg
+ throwSqlError $ Types.SqlError "" (fromIntegral errno) msg
-- Returns the last connection-level error.
connectionError :: Ptr MYSQL -> IO a
connectionError mysql_ = do
errno <- mysql_errno mysql_
msg <- peekCString =<< mysql_error mysql_
- throwDyn $ Types.SqlError "" (fromIntegral errno) msg
+ throwSqlError $ Types.SqlError "" (fromIntegral errno) msg
{- ---------------------------------------------------------------------- -}
View
4 HDBC-mysql.cabal
@@ -1,7 +1,7 @@
Name: HDBC-mysql
Category: Database
Synopsis: MySQL driver for HDBC
-Version: 0.4
+Version: 0.5
Description: This package provides a MySQL driver for HDBC.
Stability: Experimental
Maintainer: Chris Waterson <waterson@maubi.net>
@@ -10,7 +10,7 @@ Copyright: Copyright (c) 2009 Chris Waterson
License: LGPL
License-file: COPYING
Homepage: http://www.maubi.net/~waterson/hacks/hdbc-mysql.html
-Build-Depends: base >= 3 && < 4, bytestring, time, HDBC >= 1.1.0
+Build-Depends: base, bytestring, time, HDBC >= 2.1.0
Exposed-modules: Database.HDBC.MySQL
Other-modules: Database.HDBC.MySQL.Connection
ghc-options: -Wall

0 comments on commit 5ab2207

Please sign in to comment.
Something went wrong with that request. Please try again.