On May 22, 2006, at 2:38 PM, [EMAIL PROTECTED] wrote:

I am starting to get productive using MochiKit, but I cannot quite get
the grip of chained Deferreds.

I have a postJSONDoc function that I got from this group
(http://groups.google.com/group/mochikit/msg/dd23d8779dce92f3? dmode=source)
that looks like this:

...
This function is called from my code whenever I need to perform a POST.

Now, my problem is that I need to examine the response before I return
it.
If the message equals a special error message from the server, I need
to take special actions before returning the response, so I thought
that chained Deferreds might be a solution.

However, all my attempts to do so have failed.
Does anyone have any suggestions?

You should post one of your attempts. It's not clear to me why you can't just use a straightforward addCallback to do what you want.

-bob

X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.54.63.10 with SMTP id l10mr196215wra;
       Mon, 22 May 2006 08:00:10 -0700 (PDT)
Return-Path: <[EMAIL PROTECTED]>
Received: from redivi.com (redivi.com [64.207.133.54])
       by mx.googlegroups.com with ESMTP id v23si1044091cwb.2006.05.22.08.00.10;
       Mon, 22 May 2006 08:00:10 -0700 (PDT)
Received-SPF: pass (googlegroups.com: best guess record for domain of [EMAIL 
PROTECTED] designates 64.207.133.54 as permitted sender)
Received: from [213.213.135.203] (helo=[192.168.0.114])
        by redivi.com with esmtpsa (TLSv1:RC4-SHA:128)
        (Exim 4.43)
        id 1FiBt9-0004mk-Jq; Mon, 22 May 2006 08:00:09 -0700
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain
Message-Id: <[EMAIL PROTECTED]>
Cc: "MochiKit" <[email protected]>
From: Bob Ippolito <[EMAIL PROTECTED]>
Date: Mon, 22 May 2006 15:00:00 +0000
To: [EMAIL PROTECTED]
X-Mailer: Apple Mail (2.750)
X-SA-Exim-Connect-IP: 213.213.135.203
X-SA-Exim-Mail-From: [EMAIL PROTECTED]
Subject: Re: [mochikit] Chained Deferreds
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on redivi.com
X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2
X-SA-Exim-Version: 4.1+cvs (built Mon, 23 Aug 2004 08:44:05 -0700)
X-SA-Exim-Scanned: Yes (on redivi.com)


On May 22, 2006, at 2:38 PM, [EMAIL PROTECTED] wrote:

I am starting to get productive using MochiKit, but I cannot quite get
the grip of chained Deferreds.

I have a postJSONDoc function that I got from this group
(http://groups.google.com/group/mochikit/msg/dd23d8779dce92f3? dmode=source)
that looks like this:

...
This function is called from my code whenever I need to perform a POST.

Now, my problem is that I need to examine the response before I return
it.
If the message equals a special error message from the server, I need
to take special actions before returning the response, so I thought
that chained Deferreds might be a solution.

However, all my attempts to do so have failed.
Does anyone have any suggestions?

You should post one of your attempts. It's not clear to me why you can't just use a straightforward addCallback to do what you want.

-bob


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to