Component API C®++ error codes

Numeric error codes are returned when Global Name Management components encounter an error. When you encounter an error, check the Global Name Management documentation for the error code number to obtain information about the type of error, where it occurred, and how to fix it.

Error code syntax

The exception class, ibmgnr::Exception, is used to report error information. Errors are divided into three categories – data, input, or internal errors – that can be used to differentiate between the cause and severity of the error. Several methods are included with this class that can be used by client applications. Text information can be retrieved by calling the ibmgnr::Exception::text() method and integer values can be retrieved by calling the ibmgnr::Exception::value() method. The following example illustrates what a basic catch clause for this type of exception might look like.


catch (ibmgnr::Exception & e)
{
  ibmgnr::Exception Type type = e.type(),
  char component = e.component(),
  int code = e.code(),
  std::string text = e.text(),
  reportComplexError(type, component, code, text),
};
   
ExceptionType type()
Enumerator that describes what type of error was encountered. Three different values can be returned for type():
Internal
Internal error, cannot continue.
Reference data
Reference data corruption, cannot continue.
Input
Invalid input data.
component()
Returns a single-letter code that identifies the Global Name Management component where the error originated. The following values are valid for the component() function:
Identifier Component
A Country of Association
C NameClassifier
D Distributed Search
H NameHunter
I Global error 1
N NameClassifier Country of Association
P NameParser®
S NameSifter
T NameTransliterator
V NameVariantGenerator
W NameWorks
1

Internal errors (001–006) appear as GODInnnE, where nnn is the numeric code returned. The letter I indicates a global error, which can be reported by any component. For example, the error, GODH002E means a file open error (002) occurred in NameHunter (H). This same error can occur in another component, such as NameParser, where the error would appear as GODP002E. When referring to the documentation for errors 001–006, check the single-letter code that precedes the numeric error to identify the component where the error occurred.

code()
Returns the error code associated with a specific error condition.
const throw()
Returns associated text information that might accompany an error.
value() const
Returns the integer value that might be associated with an error.
id() const throw() | wid() const throw()
Returns a string in the format GODcnnnE that identifies the error condition.
GOD
Three-letter error identification prefix assigned to Global Name Management components.
c
Single-character component identifier returned by the char component() method.
nnn
Numeric error code returned by the code() function.
E
Standard IBM® indicator for error messages.
const throw()
Returns a string that contains both the error condition identifier and any associated integer value and text information, separated by a single space character.