[web-devel] Happstack stack overflow
Mister Asafe Ribeiro
asafe.hai.kai at gmail.com
Sun Jul 3 22:22:45 CEST 2011
Hi, I have a handler for a post request that uses CouchDB to save a new
newBookHandler :: ServerPart Response
newBookHandler = do
title <- look "Title"
description <- look "Description"
type' <- lookRead "Type"
permission <- lookRead "Permission"
let author = "Asafe"
liftIO $ createBook (Book title type' author description permission)
ok $ toResponse ( Template.books "Your new book was just created !
Give it some love now")
create is defined like that:
createBook book = runCouchDB' $ newDoc db' $ toJSON book
However when I perform the post request I get: Server error : Stack
overflow. All works fine if I comment the line of createBook. I must be
missing something because I was not able to use macid neither...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the web-devel