WriteError class

From m204wiki
Revision as of 22:29, 8 August 2016 by JAL (talk | contribs) (Created page with "This page is under construction. __NOTOC__ WriteError exceptions are typically thrown by the Parse function in the WriteError class when...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

MethodDescription
NewCreate a new WriteError object
ReturnCodeReturn code from failed write

The methods in the class are described in the subsections that follow. In addition:

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

%jsonParseErrorA reference to an instance of a WriteError object.
[%(WriteError):]The class name in parentheses denotes a Constructor.
numberThe character position in the input unicode string where the parse error was detected.
stringText that describes the error. It must be 127 characters long or less.

Usage notes

  • Since the WriteError exception does not provide