Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

box.error.new() - create an error object with no throw #512

Closed
TarantoolBot opened this issue May 8, 2018 · 0 comments
Closed

box.error.new() - create an error object with no throw #512

TarantoolBot opened this issue May 8, 2018 · 0 comments
Assignees
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality

Comments

@TarantoolBot
Copy link
Collaborator

box.error.new(error_code, args) - the way to create an error object and do not throw it, but just return as the simple object. It is useful when an error object must be saved to be got later, for example.

tarantool> e = box.error.new(box.error.CREATE_SPACE, "space", "error")
tarantool> e
---
- 'Failed to create space ''space'': error'
...
tarantool> e:unpack()
---
- type: ClientError
  code: 9
  message: 'Failed to create space ''space'': error'
  trace:
  - file: '[string "e = box.error.new(box.error.CREATE_SPACE, "sp..."]'
    line: 1
...

Requested by @Gerold103 in tarantool/tarantool#3031.

@lenkis lenkis added feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality 1.10 labels May 10, 2018
@lenkis lenkis added this to To do in Community docs Jun 19, 2018
@lenkis lenkis moved this from To do to In progress in Community docs Jun 19, 2018
@lenkis lenkis moved this from In progress to Peer review in Community docs Jun 19, 2018
@lenkis lenkis moved this from Peer review to Done in Community docs Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality
Projects
No open projects
Development

No branches or pull requests

3 participants