Exception Classes

To handle errors and exceptions - expected or unexpected - TX Text Control implements a detailed exception handling with different exception classes that informs about the error number and specific details:

Some errors are summarized to error groups with similar reasons. In all cases, an error number is provided in the exception message text. The following code is causing an exception as we are trying to load an invalid RTF string:

try {
textControl1.Load("test", TXTextControl.StringStreamType.RichTextFormat);
}
catch (FilterException exc) {
Debug.WriteLine("Message: {0}, Reason: {1}", exc.Message, exc.Reason.ToString());
}
view raw test.cs hosted with ❤ by GitHub
Message: Text filter error: The file type is not supported through the filter.
(1-1D01), Reason: WrongFileType

In this case, the error description is very clear, but in other cases, the error number itself can provide some more details about the reason for the caused error.

Error Navigator

For these purposes, we launched the Text Control Error Navigator that can be used to search for error numbers in various modules. The interface is very simple:

Text Control Error Navigator

It is possible to filter by error number and module. Let's search for the error number from our forced exception above (search for the second part after the dash):

Text Control Error Navigator

To help you to integrate the error search into your own development environment and CI/CD pipelines, we provide a Web API for this search as well. The following endpoints are available:

https://errors.textcontrol.com/api/errors?number=2c&module=TextControl

[
  {
    "number":"1D01",
    "description":"Filter error: the text data to be imported has the wrong text format.",
    "module":"TextControl"
  }
]

https://errors.textcontrol.com/api/errors/modules

[
  {
    "module":"FormatChecking"
  },
  {
    "module":"GraphicsImportFilter"
  },
  {
    "module":"ImageModule"
  },
  {
    "module":"OleObjects"
  },
  {
    "module":"TextControl"
  }
]

Test this error navigator on your own:

https://errors.textcontrol.com