[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
book:

newBookHandler :: ServerPart Response
newBookHandler = do
        methodM POST
        decodeBody myPolicy
        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...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110703/33411caa/attachment.htm>


More information about the web-devel mailing list