Marko Apfel - Afghanistan/Belgium/Germany

Management, Architecture, Programming, QA, Coach, GIS, EAI

  Home  |   Contact  |   Syndication    |   Login
  168 Posts | 2 Stories | 131 Comments | 4 Trackbacks

News



Twitter | LinkedIn | Xing

Article Categories

Archives

Post Categories

BizTalk

C#

Enterprise Library

SAP

SQL Server

Technologie

to catch the COM-Exception in own applications thrown from the underlaying ArcObjects-Library could be done with:

catch (COMException ComEx)
{
    Console.WriteLine(string.Format("MyCode errored: {0}, Error Code: {1}",
        ComEx.Message, ComEx.ErrorCode));
}

the special error constants could be found under:

ArcObjects Library Reference  (GeoDatabase) - fdoError Constants

posted on Tuesday, October 20, 2009 2:36 PM

Feedback

# re: Catching COM-Exceptions from ArcObjects 12/7/2009 5:48 AM Martijn Coppoolse
That's right. I even add the error constant's name, if applicable, like this:

m_Message &= " (" & ComEx.Source
If System.Enum.IsDefined(GetType(fdoError), ComEx.ErrorCode) Then
m_Message &= "; " & System.Enum.GetName(GetType(fdoError), ComEx.ErrorCode)
End If
m_Message &= ")"

(The fdoError enum is located in the ESRI.ArcGIS.Geodatabase namespace.)

Post A Comment
Title:
Name:
Email:
Comment:
Verification: