Include JSON content type for errors

This commit is contained in:
Joe Nelson
2015-01-31 12:33:44 -08:00
parent f06f3e3394
commit 90f9b00e5e
2 changed files with 3 additions and 3 deletions
+3 -1
View File
@@ -12,11 +12,13 @@ import Data.Aeson ((.=))
import Data.String.Conversions (cs)
import Data.String.Utils(replace)
import Network.Wai(Response, responseLBS)
import Network.HTTP.Types.Header
type PgError = H.SessionError P.Postgres
errResponse :: PgError -> Response
errResponse e = responseLBS (httpStatus e) [] (JSON.encode e)
errResponse e = responseLBS (httpStatus e)
[(hContentType, "application/json")] (JSON.encode e)
instance JSON.ToJSON PgError where
toJSON (H.TxError (P.ErroneousResult c m d h)) = JSON.object [
-2
View File
@@ -16,8 +16,6 @@ import Control.Monad (replicateM_)
import TestTypes(IncPK(..), CompoundPK(..))
--import Debug.Trace
spec :: Spec
spec = afterAll_ resetDb $ around withApp $ do
describe "Posting new record" $ do