[Twisted-Python] twisted.protocols.basic.NetstringReceiver: Some errors are not visible

From twisted/protocols/basic.py:
class NetstringReceiver(protocol.Protocol): def doLength(self): ... raise NetstringParseError, "netstring too long" ... def dataReceived(self, data): ... try: ... self.doLength() ... except NetstringParseError: self.transport.loseConnection() self.brokenPeer = 1 The error message "netstring too long" is shadowed by the except block. I'd like to see it in my log files. Would it make sense to emit logging messaged for those errors, or is there any particular reason why they are silenced? Cheers, Carlos

On Tue, Apr 06, 2010 at 11:47:48AM +0100, Carlos Valiente wrote:
The error message "netstring too long" is shadowed by the except block. I'd like to see it in my log files.
Would it make sense to emit logging messaged for those errors, or is there any particular reason why they are silenced?
I don't know if there is a particular reason for silencing the errors. But most classes in basic.py do not emit any log messages (the only exception is StatefulStringProtocol). BTW: There is a ticket about NetstringReceiver - you might want to add your request there: http://twistedmatrix.com/trac/ticket/4378 Best regards, Albert -- Albert Brandl Weiermayer Solutions GmbH Abteistraße 12 A-4813 Altmünster phone: +43 (0) 720 70 30 14 fax: +43 (0) 7612 20 3 56 web: http://www.weiermayer.com

On Tue, Apr 06, 2010 at 11:47:48AM +0100, Carlos Valiente wrote:
[...] The error message "netstring too long" is shadowed by the except block. I'd like to see it in my log files.
The problems described in http://twistedmatrix.com/trac/ticket/4378 have been fixed now. Would you like to create a new ticket about the missing log messages? -- Best regards, Albert Brandl Weiermayer Solutions GmbH Abteistraße 12 A-4813 Altmünster phone: +43 (0) 720 70 30 14 fax: +43 (0) 7612 20 3 56 web: http://www.weiermayer.com

On Wed, Jul 14, 2010 at 10:20, Albert Brandl <albert.brandl@weiermayer.com> wrote:
On Tue, Apr 06, 2010 at 11:47:48AM +0100, Carlos Valiente wrote:
[...] The error message "netstring too long" is shadowed by the except block. I'd like to see it in my log files.
The problems described in http://twistedmatrix.com/trac/ticket/4378 have been fixed now. Would you like to create a new ticket about the missing log messages?
Thanks for the heads-up, Albert. I switched from NetstringReceiver to Int32StringReceiver, so I don't really need the error message any longer. C
participants (2)
-
Albert Brandl
-
Carlos Valiente