[Twisted-web] Error chanel in Nevow.Athena

Jean-Paul Calderone exarkun at divmod.com
Mon Jul 20 10:47:48 EDT 2009


On Mon, 20 Jul 2009 11:33:45 -0300, Juanjo Conti <jjconti at gmail.com> wrote:
>2009/7/19 Glyph Lefkowitz <glyph at divmod.com>:
>> On Sun, Jul 19, 2009 at 6:55 PM, Juanjo Conti<jjconti at gmail.com> wrote:
>>> I have notice that when an error occur in a LiveElement (lost
>>> connection or not handled exception in the server) an error message is
>>> displayed in the browser. Is there an explicit way to use this error
>>> showing mechanism to display errors from my application? This stuff
>>> seems not covered in Athena documentation.
>>
>> The error dialog you're noticing comes from
>> Nevow.Athena.PageWidget.showErrorDialog (which is defined in
>> Nevow/nevow/js/Nevow/Athena/__init__.js).
>>
>> The PageWidget is the root JavaScript class that controls everything
>> that's going on on the page.  If you want to customize this, you
>> should subclass Nevow.Athena.PageWidget in your application, and
>> override showErrordDialog.  On the Python side of things, you need to
>> subclass nevow.athena.LivePage, and set your subclass's jsClass
>> attribute to the name of your PageWidget subclass.
>[..]
>
>Ok, but I don't actually need a customization, I'm just fine using the
>showErrorDialog. How can I acces the correct PageWidget instance?
>myLivePage.jsClass?
>
>So I can do myLivePage.jsClass.showErrorDialog(some params); right?
>
>> This could definitely be better documented.  Can you contribute a
>> documentation patch that explains that stuff I just said? :-)
>
>As soon as I get something done, I'll contribute with doc.
>

If you're trying to do it from the Python side:

   livePage.callRemote("showErrorDialog", ...)

If you're trying to do it from the JavaScript side:

   widget.getPageWidget().showErrorDialog(...)

I've never tried either, but it seems like they should work. ;)

Jean-Paul



More information about the Twisted-web mailing list