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:
- Filter
Exception ╰ TX Text Control .NET for Windows Forms
╰ TXTextControl Namespace
╰ FilterException Class
The FilterException class informs about errors which can occur when a text filter is used to convert a document to or from another format. - Formula
Exception ╰ TX Text Control .NET for Windows Forms
╰ TXTextControl Namespace
╰ FormulaException Class
The FormulaException class informs about an invalid syntax or missing parameters of formulas used in tables. - License
Level Exception ╰ TX Text Control .NET for Windows Forms
╰ TXTextControl Namespace
╰ LicenseLevelException Class
A LicenseLevelException is thrown when a feature is not contained in the currently licensed product level. - Number
Format Exception ╰ TX Text Control .NET for Windows Forms
╰ TXTextControl Namespace
╰ NumberFormatException Class
The NumberFormatException class informs about an invalid syntax of a numberformat used to display a formula result. - Text
Editor Exception ╰ TX Text Control .NET for Windows Forms
╰ TXTextControl Namespace
╰ TextEditorException Class
The TextEditorException class informs about errors which can occur during editing text.
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()); | |
} |
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:
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):
Web API Search
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: