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

Refactor box.execute to not throw #4390

Closed
kyukhin opened this issue Jul 30, 2019 · 0 comments
Closed

Refactor box.execute to not throw #4390

kyukhin opened this issue Jul 30, 2019 · 0 comments
Assignees
Labels
bug Something isn't working refactoring Code refactoring sql
Milestone

Comments

@kyukhin
Copy link
Contributor

kyukhin commented Jul 30, 2019

Currently box.execute uses exceptions mechanism to report an error.
According to Lua coding style it should use Go-style res, err = ....

@kyukhin kyukhin added bug Something isn't working refactoring Code refactoring sql labels Jul 30, 2019
@kyukhin kyukhin added this to the 2.2.0 milestone Jul 30, 2019
ImeevMA added a commit that referenced this issue Jul 30, 2019
In accordance with the Lua coding style in Tarantool, all errors
returned in Lua should be returned using 'return nil, error'.
However, box.execute() throws an exception in case of an error.
This patch causes box.execute() to return an error, as described
in the coding style.

Closes #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
In accordance with the Lua coding style in Tarantool, all errors
returned in Lua should be returned using 'return nil, error'.
However, box.execute() throws an exception in case of an error.
This patch causes box.execute() to return an error, as described
in the coding style.

Closes #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
Currently, if we have to return errors using the format
'return nil, error', we must do it manually. Since this error
return method is described in our Lua coding style, it makes sense
to create a function that will return an error in this format.
This patch creates a function.

Needed for #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
In accordance with the Lua coding style in Tarantool, all errors
returned in Lua should be returned using 'return nil, error'.
However, box.execute() throws an exception in case of an error.
This patch causes box.execute() to return an error, as described
in the coding style.

Closes #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
Currently, if we have to return errors using the format
'return nil, error', we must do it manually. Since this error
return method is described in our Lua coding style, it makes sense
to create a function that will return an error in this format.
This patch creates a function.

Needed for #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
In accordance with the Lua coding style in Tarantool, all errors
returned in Lua should be returned using 'return nil, error'.
However, box.execute() throws an exception in case of an error.
This patch causes box.execute() to return an error, as described
in the coding style.

Closes #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
Currently, if we have to return errors using the format
'return nil, error', we must do it manually. Since this error
return method is described in our Lua coding style, it makes sense
to create a function that will return an error in this format.
This patch creates a function.

Needed for #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
In accordance with the Lua coding style in Tarantool, all errors
returned in Lua should be returned using 'return nil, error'.
However, box.execute() throws an exception in case of an error.
This patch causes box.execute() to return an error, as described
in the coding style.

Closes #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
Currently, if we have to return errors using the format
'return nil, error', we must do it manually. Since this error
return method is described in our Lua coding style, it makes sense
to create a function that will return an error in this format.
This patch creates a function.

Needed for #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
In accordance with the Lua coding style in Tarantool, all errors
returned in Lua should be returned using 'return nil, error'.
However, box.execute() throws an exception in case of an error.
This patch causes box.execute() to return an error, as described
in the coding style.

Closes #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
Currently, if we have to return errors using the format
'return nil, error', we must do it manually. Since this error
return method is described in our Lua coding style, it makes sense
to create a function that will return an error in this format.
This patch creates mentioned function.

Needed for #4390
ImeevMA added a commit that referenced this issue Jul 31, 2019
In accordance with the Lua coding style in Tarantool, all errors
returned in Lua should be returned using 'return nil, error'.
However, box.execute() throws an exception in case of an error.
This patch causes box.execute() to return an error, as described
in the coding style.

Closes #4390
Gerold103 pushed a commit that referenced this issue Aug 1, 2019
Currently, if we have to return errors using the format
'return nil, error', we must do it manually. Since this error
return method is described in our Lua coding style, it makes sense
to create a function that will return an error in this format.
This patch creates mentioned function.

Needed for #4390
Gerold103 pushed a commit that referenced this issue Aug 1, 2019
In accordance with the Lua coding style in Tarantool, all errors
returned in Lua should be returned using 'return nil, error'.
However, box.execute() throws an exception in case of an error.
This patch causes box.execute() to return an error, as described
in the coding style.

Closes #4390
kyukhin pushed a commit that referenced this issue Aug 2, 2019
Currently, if we have to return errors using the format
'return nil, error', we must do it manually. Since this error
return method is described in our Lua coding style, it makes sense
to create a function that will return an error in this format.
This patch creates mentioned function.

Needed for #4390
@kyukhin kyukhin closed this as completed in 98e29c0 Aug 2, 2019
@kyukhin kyukhin added feature A new functionality bug Something isn't working tmp and removed bug Something isn't working feature A new functionality labels Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactoring Code refactoring sql
Projects
None yet
Development

No branches or pull requests

3 participants