When Interop with Outlook, I need to handle several exceptions, they are all COMException
with the same HResult
, the only difference is in their Message property.
I have to tell them from each other by examining the Message property, but such code is asking for trouble.
if (ex.Message.Contains("is bigger than the server allows")) //???
So what is the proper way to handle exception when examining the type of exception and the HResult property won't work?