Error detection and description
Because NlsMessageCatalog is intended for use at runtime and debugging facilities might not be available, error codes are employed to provide an error tracing mechanism. The value of the current error code should be examined after each operation to determine if an error occurred during the last operation. Alternatively, the hasErrorOccurred message can be used to check if an error occurred during the last operation.
List of error codes
The following list includes all error codes and their corresponding messages. Each error code is associated with a descriptive error string and an error object, which is typically related to the current error or the cause of the current error. This error object can be obtained by sending the currentErrorObject message to an instance of NlsMessageCatalog. Similarly, the descriptive error string can be obtained by sending the currentErrorString to an instance of NlsMessageCatalog. The interpretation of the error object for each error is provided below.
0
Error string: 'No Errors.'
Error object: nil
1000
Error string: 'Locale not supported.'
Error object: Locale name for which messages could not be found.
1002
Error string: 'The pool being initialized contains keys for which no translations exist.'
Error object: A set of the keys missing translations.
1003
Error string: 'Could not open specified file.'
Error object: The pathname of the file that could not be opened.
1004
Error string: 'Non-portable messages detected.'
Error object: The message strings that are not portable.
1005
Error string: 'Error renaming file. Ensure file name is valid and no old working files exist.'
Error object:
Array
with: name of file being renamed
with: name of rename target
with: CfsError resulting from failed attempt to rename file.
1006
Error string: 'Error removing secondary working file.'
Error object:
Array
with: name of secondary working file
with: CfsError resulting from failed attempt to rename file.
1007
Error string: 'Invalid attempt to crossload.'
Error object: An instance of NlsMessageCatalogHeader.
1010
Error string: 'File write error.'
Error object:
Array
with: an instance of NlsMessageCatalogHeader
with: number of bytes that should have been written
with: number of bytes actually written
1011
Error string: 'FatalError: Object size estimation failed--working file is corrupt.'
Error object: Object for which size estimation failed.
1012
Error string: 'Catalog file is corrupt (or not a catalog file).'
Error object: An instance of NlsMessageCatalogHeader.
1013
Error string: 'Invalid indexed message identifier (must be >0).'
Error object: The invalid indexed message identifier.
1014
Error string: 'Indexed message not found.'
Error object:
Array
with: Locale name for which message could not be found.
with: Index of message which could not be found.
1015
Error string: 'No messages stored for locale.'
Error object: Locale name for which messages could not be found.
1016
Error string: 'No message dictionary available.'
Error object: Locale name for which messages could not be found.
1017
Error string: 'Locale not found.'
Error object: Locale name for which messages could not be found.
2000
Error string: 'Error encountered loading object.'
Error object: An instance of ObjectLoader.
2001
Error string: 'Error encountered dumping object.'
Error object: An instance of ObjectDumper.
Support for packaging
The NlsMessageCatalog function described in the previous sections is partitioned between the applications NlsExternalizationRuntime and NlsExternalizationTools to support packaging.
NlsExternalizationRuntime provides the necessary class definitions for NlsMessageCatalog, its support classes, and all protocols required for reading and querying message catalog files. NlsExternalizationTools defines extensions to the basic NlsMessageCatalog and its support classes to enable creation of message catalog files. If the application being packaged has no requirement to create message catalog files at runtime, only the NlsExternalizationRuntime application should be included in the packaged image.
The NlsExternalizationTools application also defines the RCConverter class that assists in converting localized message dictionaries to Microsoft Windows resource file formats. The RCConverter class is intended primarily for use in a development image and should most likely be excluded from a runtime image.
Last modified date: 01/29/2015