Implement two new calls: box.error.last() - returns last error, if any, as a Lua table box.error.clear() - clears the last error
And add an alias for box.error(): box.error.raise()
Example:
box.error.last()
---- null
...
box.error({code =123, reason ='test'})
---- error: test
...
box.error(box.error.ILLEGAL_PARAMS, "bla bla")
---- error: Illegal parameters, bla bla
...
box.error.last()
---- type: ClientError
message: Illegal parameters, bla bla
code: 1...
box.error.clear()
---...
box.error.last()
---- null
...
Observe, that the returned lua table has three members:
type: C++ class type of the error
message: string message for the error
code: numeric code of the error, as passed to box.error(), usually one of the codes in box.error Lua table
Additionally, if the error is a system error (socket, file or memory related) a new member 'errno' contains C standard errno.
The text was updated successfully, but these errors were encountered:
* implement two new calls:
box.error.last() - returns last error, if any, as a Lua table
box.error.clear() - clears the last error
* add an alias for box.error(), box.error.raise()
Implement two new calls:
box.error.last()- returns last error, if any, as a Lua tablebox.error.clear()- clears the last errorAnd add an alias for
box.error():box.error.raise()Example:
Observe, that the returned lua table has three members:
type: C++ class type of the errormessage: string message for the errorcode: numeric code of the error, as passed to box.error(), usually one of the codes in box.error Lua tableAdditionally, if the error is a system error (socket, file or memory related) a new member 'errno' contains C standard errno.
The text was updated successfully, but these errors were encountered: