# handling pywintypes.error exceptions

Sat Mar 5 20:14:18 CET 2005

I'm using the win32 api to map samba shares, and I'm having trouble
handling some exceptions.  In my script there are 2 possible exceptions
when the script attempts to map a share:

Traceback (most recent call last):
File "<stdin>", line 1, in ?

This exception occurs when '\\foo\bar' is not an existing share. Also,
when a drive letter is already in use the following occurs:

{'remote':r'\\some_server\share','local':'Y:'})
Traceback (most recent call last):
File "<stdin>", line 1, in ?
in use.')

I know the exception raised in these cases is "pywintypes.error", but
how can i differentiate between the two exceptions? Being able to do
this is critical for my script....