Quantcast

PyAMF DjangoGateway Blocking Exception Emails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

PyAMF DjangoGateway Blocking Exception Emails

Kyle Gong
I've got PyAMF's DjangoGateway set up and working really well for my backend server, but unfortunately it seems to be preventing Django from triggering the emails it typically sends when an error occurs, because the PyAMF DjangoGateway is catching the exceptions and returning a short error message over AMF to the client.  Is there any easy way to disable this functionality?  The error message that PyAMF provides is usually not very helpful in comparison to the Django emails which give a full traceback, and most importantly I need the error information sent to me instead of to the client.

I tried passing a logger to the DjangoGateway, but it only seems to be calling the logger at the debug level (rather than the Error level), even when an Exception occurs.

----
Kyle Gong VP Engineering
Phone (805) 706-0910 | [hidden email]

kiwi interactive www.kiwiinteractive.com
555 W 59th St 6E New York, NY 10019

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PyAMF DjangoGateway Blocking Exception Emails

Nick Joyce

On Thursday, 21 July 2011 at 5:24 PM, Kyle Gong wrote:

I've got PyAMF's DjangoGateway set up and working really well for my backend server, but unfortunately it seems to be preventing Django from triggering the emails it typically sends when an error occurs, because the PyAMF DjangoGateway is catching the exceptions and returning a short error message over AMF to the client. Is there any easy way to disable this functionality?? The error message that PyAMF provides is usually not very helpful in comparison to the Django emails which give a full traceback, and most importantly I need the error information sent to me instead of to the client.
This is one place where PyAMF/Django integration falls down. A generic error handler on BaseGateway could be used to push the exception through the standard Django channels. This would also give an opportunity to modify the AMF response so that the client doesn't have to get all the gory details, just a 'this was not successful' message.

If the general consensus is that this is a good idea, then I'll create a ticket and it will be in the 0.7 release.


I tried passing a logger to the DjangoGateway, but it only seems to be calling the logger at the debug level (rather than the Error level), even when an Exception occurs.
The gateway's use logger.exception to do the logging so its up the the logging subsystem to handle that.

Cheers,

Nick

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PyAMF DjangoGateway Blocking Exception Emails

Kyle Gong

This would be very helpful. I was thinking about making a patch myself, but I don't think I am familiar enough with the other gateways well enough to do it at the base level.

Thanks Nick.

On Jul 21, 2011 4:21 PM, "Nick Joyce" <[hidden email]> wrote:
> On Thursday, 21 July 2011 at 5:24 PM, Kyle Gong wrote:
> I've got PyAMF's DjangoGateway set up and working really well for my backend server, but unfortunately it seems to be preventing Django from triggering the emails it typically sends when an error occurs, because the PyAMF DjangoGateway is catching the exceptions and returning a short error message over AMF to the client. Is there any easy way to disable this functionality? The error message that PyAMF provides is usually not very helpful in comparison to the Django emails which give a full traceback, and most importantly I need the error information sent to me instead of to the client.
>>
>
> This is one place where PyAMF/Django integration falls down. A generic error handler on BaseGateway could be used to push the exception through the standard Django channels. This would also give an opportunity to modify the AMF response so that the client doesn't have to get all the gory details, just a 'this was not successful' message.
>
> If the general consensus is that this is a good idea, then I'll create a ticket and it will be in the 0.7 release.
>>
>>
>> I tried passing a logger to the DjangoGateway, but it only seems to be calling the logger at the debug level (rather than the Error level), even when an Exception occurs.
> The gateway's use logger.exception to do the logging so its up the the logging subsystem to handle that.
>
> Cheers,
>
> Nick

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PyAMF DjangoGateway Blocking Exception Emails

Joni Bekenstein
+1 for that!

--
Joni Bekenstein




On Thu, Jul 21, 2011 at 8:32 PM, Kyle Gong <[hidden email]> wrote:

> This would be very helpful. I was thinking about making a patch myself, but
> I don't think I am familiar enough with the other gateways well enough to do
> it at the base level.
>
> Thanks Nick.
>
> On Jul 21, 2011 4:21 PM, "Nick Joyce" <[hidden email]> wrote:
>> On Thursday, 21 July 2011 at 5:24 PM, Kyle Gong wrote:
>> I've got PyAMF's DjangoGateway set up and working really well for my
>> backend server, but unfortunately it seems to be preventing Django from
>> triggering the emails it typically sends when an error occurs, because the
>> PyAMF DjangoGateway is catching the exceptions and returning a short error
>> message over AMF to the client. Is there any easy way to disable this
>> functionality? The error message that PyAMF provides is usually not very
>> helpful in comparison to the Django emails which give a full traceback, and
>> most importantly I need the error information sent to me instead of to the
>> client.
>>>
>>
>> This is one place where PyAMF/Django integration falls down. A generic
>> error handler on BaseGateway could be used to push the exception through the
>> standard Django channels. This would also give an opportunity to modify the
>> AMF response so that the client doesn't have to get all the gory details,
>> just a 'this was not successful' message.
>>
>> If the general consensus is that this is a good idea, then I'll create a
>> ticket and it will be in the 0.7 release.
>>>
>>>
>>> I tried passing a logger to the DjangoGateway, but it only seems to be
>>> calling the logger at the debug level (rather than the Error level), even
>>> when an Exception occurs.
>> The gateway's use logger.exception to do the logging so its up the the
>> logging subsystem to handle that.
>>
>> Cheers,
>>
>> Nick
>
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users
>
>
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PyAMF DjangoGateway Blocking Exception Emails

Kyle Gong
In reply to this post by Kyle Gong
I wrote a patch which introduces an optional argument to the BaseGateway, send_error_responses which if set to False will avoid PyAMF's error handling and instead trigger Django's exception handling.

I'm not sure what your process is for incorporating changes, but I've attached the diff in case it is of use to you.




----
Kyle Gong
Chief Technology Officer
(805) 706-0910
[hidden email]

kiwi interactive www.kiwiinteractive.com
555 W 59th St 6E New York, NY 10019

On Jul 21, 2011, at 4:32 PM, Kyle Gong wrote:

> This would be very helpful. I was thinking about making a patch myself, but I don't think I am familiar enough with the other gateways well enough to do it at the base level.
>
> Thanks Nick.
>
> On Jul 21, 2011 4:21 PM, "Nick Joyce" <[hidden email]> wrote:
> > On Thursday, 21 July 2011 at 5:24 PM, Kyle Gong wrote:
> > I've got PyAMF's DjangoGateway set up and working really well for my backend server, but unfortunately it seems to be preventing Django from triggering the emails it typically sends when an error occurs, because the PyAMF DjangoGateway is catching the exceptions and returning a short error message over AMF to the client. Is there any easy way to disable this functionality? The error message that PyAMF provides is usually not very helpful in comparison to the Django emails which give a full traceback, and most importantly I need the error information sent to me instead of to the client.
> >>
> >
> > This is one place where PyAMF/Django integration falls down. A generic error handler on BaseGateway could be used to push the exception through the standard Django channels. This would also give an opportunity to modify the AMF response so that the client doesn't have to get all the gory details, just a 'this was not successful' message.
> >
> > If the general consensus is that this is a good idea, then I'll create a ticket and it will be in the 0.7 release.
> >>
> >>
> >> I tried passing a logger to the DjangoGateway, but it only seems to be calling the logger at the debug level (rather than the Error level), even when an Exception occurs.
> > The gateway's use logger.exception to do the logging so its up the the logging subsystem to handle that.
> >
> > Cheers,
> >
> > Nick

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users

send_error_responses.diff (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PyAMF DjangoGateway Blocking Exception Emails

Nick Joyce
Awesome, ty.

The pattern is to create a ticket on dev.pyamf.org/newticket and iterate over the patch from there.

Do you have any unit tests to go with this patch?

On Friday, 19 August 2011 at 2:25 AM, Kyle Gong wrote:

I wrote a patch which introduces an optional argument to the BaseGateway, send_error_responses which if set to False will avoid PyAMF's error handling and instead trigger Django's exception handling.

I'm not sure what your process is for incorporating changes, but I've attached the diff in case it is of use to you.


----
Kyle Gong
Chief Technology Officer
(805) 706-0910
[hidden email]

kiwi interactive www.kiwiinteractive.com
555 W 59th St 6E New York, NY 10019

On Jul 21, 2011, at 4:32 PM, Kyle Gong wrote:

This would be very helpful. I was thinking about making a patch myself, but I don't think I am familiar enough with the other gateways well enough to do it at the base level.

Thanks Nick.

On Jul 21, 2011 4:21 PM, "Nick Joyce" <[hidden email]> wrote:
On Thursday, 21 July 2011 at 5:24 PM, Kyle Gong wrote:
I've got PyAMF's DjangoGateway set up and working really well for my backend server, but unfortunately it seems to be preventing Django from triggering the emails it typically sends when an error occurs, because the PyAMF DjangoGateway is catching the exceptions and returning a short error message over AMF to the client. Is there any easy way to disable this functionality? The error message that PyAMF provides is usually not very helpful in comparison to the Django emails which give a full traceback, and most importantly I need the error information sent to me instead of to the client.

This is one place where PyAMF/Django integration falls down. A generic error handler on BaseGateway could be used to push the exception through the standard Django channels. This would also give an opportunity to modify the AMF response so that the client doesn't have to get all the gory details, just a 'this was not successful' message.

If the general consensus is that this is a good idea, then I'll create a ticket and it will be in the 0.7 release.


I tried passing a logger to the DjangoGateway, but it only seems to be calling the logger at the debug level (rather than the Error level), even when an Exception occurs.
The gateway's use logger.exception to do the logging so its up the the logging subsystem to handle that.

Cheers,

Nick
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users

Attachments:
- send_error_responses.diff


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Loading...