[p4python] p4python errors

Robert Cowham robert at vaccaperna.co.uk
Fri Jul 22 00:59:19 PDT 2005


Needs to be tidied up.

Note that setting cleint.exception_level controls if you get an exception if
there are any errors present.

I'll propose some ideas and see what people think.

Robert

> -----Original Message-----
> From: p4python-bounces at perforce.com 
> [mailto:p4python-bounces at perforce.com] On Behalf Of Smith, Jeff
> Sent: 21 July 2005 20:57
> To: p4python at perforce.com
> Subject: [p4python] p4python errors
> 
> I notice that sometimes p4python throws class type errors 
> whereas other times it throws strings as errors.  This makes 
> it ugly to catch all possible p4python errors and requires 
> something akin to:
> 
> try:
> 	client.method()
> except p4.P4Client.error:
> 	handle_this
> except:
> 	if client.errors:
> 		handle_this
> 	else:
> 		raise
> 
> and even this won't catch everything since sometimes 
> client.errors is empty
> 
> Is anyone else seeing this?
> 
> Jeff
> Python 2.4
> p4python 0.5
> 
> _______________________________________________
> p4python mailing list
> p4python at maillist.perforce.com
> http://maillist.perforce.com/mailman/listinfo/p4python
> 




More information about the p4python mailing list