Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

1 Answer 1

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.