Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok, I can trap the COM exception and convert the ErrorCode to the proper enum, (e.g. esriGeometryError.E_GEOMETRY_WRONGTYPE). But is there a way to get the error description from the enum? For example, when I mouse over esriGeometryError.E_GEOMETRY_WRONGTYPE in Visual Studio I get a popup that says "The geometry parameter was of the wrong type for the method." It would be great to retrieve that information programatticaly once the exception is trapped. Any help greatly appreciated!

share|improve this question
up vote 4 down vote accepted

The Message property of the COMException will contain the string you are looking for. See this article for code examples of error handling with HRESULTS and messages.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.