Select to view content in your preferred language

Error values in c#

2473
1
06-11-2012 06:39 PM
__11
by
Deactivated User
According to "File Geodatabase API 1.2 now available", API v1.2 includes
* Macros for error values allowing for more readable code. (NIM077630)

(Requested in thread "Macros for error values".)

The new macros in FileGDBCore.h work for C++ users, but is there an equivalent for C# users to programmatically handle specific values returned by FileGDBException.ErrorCode, eg:

catch (FileGDBException ex)
{
 switch (ex.ErrorCode)
 {
  case FileGDBError.FGDB_E_PATH_NOT_FOUND:
   ...


Currently I have my own definitions:

namespace Esri.FileGDB
{
 class FileGDBError
 {
  /*-----------------------------------------------------------------------------
   Error values. 
   (This is not a complete list.)
  */
  public const int FGDB_E_PATH_NOT_FOUND    = unchecked((int)0x80070003);
  public const int FGDB_E_FIELD_NOT_FOUND    = -2147219885;
  public const int FGDB_E_TABLE_ALREADY_EXISTS  = -2147220653;
  public const int FGDB_E_INVALID_RELEASE    = -2147220965;
  public const int FGDB_E_FEATURE_VALUE_TYPE_MISMATCH = -2147217395;
 }

}


But presumably these should be part of the delivered assembly. (Perhaps they already are, and I just don't know how to find them.)

Are the definitions available in C# in v1.2 ?
If so, how do I use them?
If not, could you add them please.
0 Kudos
1 Reply
__11
by
Deactivated User
This doesn't appear to be addressed in v1.3 either.
Of have I missed something?