WriteError class
This page is under construction.
WriteError exceptions are typically thrown by the Parse function in the WriteError class when there is an error parsing record data.
To create a WriteError exception yourself, you typically use a SOUL Throw statement with an WriteError New constructor. This statement must be issued from within a method, and it can only be caught by the code that calls the method. For example, the following statement throws a WriteError exception:
throw %(WriteError):new(characterPosition=%pos)
Remember that you catch an exception with the Catch statement; if an exception condition occurs outside a Catch for it, the request is canceled.
The WriteError class, like the WriteError class is available as of Model 204 7.6.
The WriteError methods
The following are the available WriteError class methods.
Method | Description |
---|---|
New | Create a new WriteError object |
ReturnCode | Return code from failed write |
The methods in the class are described in the subsections that follow. In addition:
- "Notation conventions for methods" has information about the conventions followed.
- "WriteError methods syntax" is a single page that contains the syntax diagrams of all the methods in the class.
CharacterPosition property
Template:WriteError:CharacterPosition subtitle
This ReadOnly property returns a number that indicates the character position (unicode characters are each two bytes long) in the unicode string being parsed where the error was detected.
Syntax
Template:WriteError:CharacterPosition syntax
Syntax terms
%number | The character position in the input unicode string where the parse error was detected. |
---|---|
jsonParseError | A reference to an instance of a WriteError object. |
Description property
Template:WriteError:Description subtitle
This ReadOnly property returns a string that describes the error that was encountered while parsing the JSON data.
Syntax
Template:WriteError:Description syntax
Syntax terms
%string | Text the describes the error that was encountered while parsing JSON data. |
---|---|
jsonParseError | A reference to an instance of a WriteError object. |
New constructor
Create a new WriteError object (WriteError class)
This Constructor generates an instance of a WriteError exception. The New method format follows:
Syntax
%writeError = [%(WriteError):]New( ReturnCode= number)
Syntax terms
%jsonParseError | A reference to an instance of a WriteError object. |
---|---|
[%(WriteError):] | The class name in parentheses denotes a Constructor. |
number | The character position in the input unicode string where the parse error was detected. |
string | Text that describes the error. It must be 127 characters long or less. |
Usage notes
- Since the WriteError exception does not provide