Missed some error calls in:

*) unsafeSqlBinOpComposite
*) sqlSelectProcessRow in the instance of SqlSelect (SqlExpr InsertFinal) InsertFinal
This commit is contained in:
Fintan Halpenny 2017-07-30 15:04:45 +01:00 committed by Chris Allen
parent 0beec06559
commit b77a0c3e71

View File

@ -82,6 +82,7 @@ data EsqueletoProblem =
| UnexpectedCase String -- | Unexpected function case encountered
| EmptySqlExprValueList -- | EEmptyList found for value list
| UnsupportedSqlInsertIntoType -- | Default Exception for sqlInsertInto
| UnsafeSqlBinOpComposite String -- | Error in unsafeSqlBinOpComposite
deriving (Show)
instance Exception EsqueletoProblem
@ -674,7 +675,7 @@ unsafeSqlBinOpComposite op sep a b = ERaw Parens $ compose (listify a) (listify
vc = v1 <> v2
err' = err . (++ (", " ++ show ((b1, v1), (b2, v2))))
err = error . ("unsafeSqlBinOpComposite: " ++)
err = throw . UnsafeSqlBinOpComposite . ("unsafeSqlBinOpComposite: " ++)
-- | (Internal) A raw SQL value. The same warning from
-- 'unsafeSqlBinOp' applies to this function as well.
@ -1201,7 +1202,7 @@ instance SqlSelect (SqlExpr InsertFinal) InsertFinal where
in ("INSERT INTO " <> table <> parens fields <> "\n", [])
sqlSelectCols info (EInsertFinal (EInsert _ f)) = f info
sqlSelectColCount = const 0
sqlSelectProcessRow = const (Right (error msg))
sqlSelectProcessRow = const (Right (throw $ UnexpectedCase msg))
where
msg = "sqlSelectProcessRow/SqlSelect/InsertionFinal: never here"