BDE 4.14.0 Production release
|
Provide a description of an error processing a document.
This component provides a single, un-constrained (value-semantic) attribute class, bdljsn::Error
, that is used to describe an error in the occured processing a (JSON) document.
location
: the location in the document where the error occuredmessage
: a description of the error that occuredThis section illustrates intended use of this component.
This component is designed to describe an error that occured when processing a (JSON) document. Suppose we are implementing a function, extractIntegerToken
, that parses a numeric token and obtains an int
value:
First, we define the function signature:
Then, we attempt to exact a int
value from the inputText
:
Now, we check the parse status and if unsuccessful, we use the status information to set the bsljsn::Error
object expected by our caller:
Finally, if the parse was successful, set the output parameter and return with status value that indicates success.