Top.Mail.Ru
box.error.new() | Tarantool
 

box.error.new()

box.error.new()

box.error.new(code, errtext[, errtext ...])

Create an error object, but do not throw. This is useful when error information should be saved for later retrieval. The parameters are the same as for box.error(), see the description there.

Parameters:
  • code (number) – number of a pre-defined error
  • errtext(s) (string) – part of the message which will accompany the error

Example:

tarantool> e = box.error.new{code = 555, reason = 'Arbitrary message'}
---
...
tarantool> e:unpack()
---
- type: ClientError
  code: 555
  message: Arbitrary message
  trace:
  - file: '[string "e = box.error.new{code = 555, reason = ''Arbit..."]'
    line: 1
...