Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
e2e6e76f
Verified
Commit
e2e6e76f
authored
1 year ago
by
Denis Smirnov
Browse files
Options
Downloads
Patches
Plain Diff
feat: convert tarantool errors into sbroad ones
parent
c6961c92
No related branches found
No related tags found
1 merge request
!1414
sbroad import
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbroad-core/src/errors.rs
+14
-0
14 additions, 0 deletions
sbroad-core/src/errors.rs
with
14 additions
and
0 deletions
sbroad-core/src/errors.rs
+
14
−
0
View file @
e2e6e76f
use
serde
::
Serialize
;
use
serde
::
Serialize
;
use
std
::
fmt
;
use
std
::
fmt
;
use
tarantool
::
error
::
Error
;
use
tarantool
::
transaction
::
TransactionError
;
use
tarantool
::
transaction
::
TransactionError
;
const
DO_SKIP
:
&
str
=
"do skip"
;
const
DO_SKIP
:
&
str
=
"do skip"
;
...
@@ -115,6 +116,8 @@ pub enum Entity {
...
@@ -115,6 +116,8 @@ pub enum Entity {
SyntaxPlan
,
SyntaxPlan
,
/// corresponds to struct Table
/// corresponds to struct Table
Table
,
Table
,
/// corresponds to struct Tarantool
Tarantool
,
/// corresponds to struct Target
/// corresponds to struct Target
Target
,
Target
,
/// tarantool transaction
/// tarantool transaction
...
@@ -192,6 +195,7 @@ impl fmt::Display for Entity {
...
@@ -192,6 +195,7 @@ impl fmt::Display for Entity {
Entity
::
SyntaxNodes
=>
"syntax nodes"
.to_string
(),
Entity
::
SyntaxNodes
=>
"syntax nodes"
.to_string
(),
Entity
::
SyntaxPlan
=>
"syntax plan"
.to_string
(),
Entity
::
SyntaxPlan
=>
"syntax plan"
.to_string
(),
Entity
::
Table
=>
"table"
.to_string
(),
Entity
::
Table
=>
"table"
.to_string
(),
Entity
::
Tarantool
=>
"tarantool"
.to_string
(),
Entity
::
Target
=>
"target"
.to_string
(),
Entity
::
Target
=>
"target"
.to_string
(),
Entity
::
Transaction
=>
"transaction"
.to_string
(),
Entity
::
Transaction
=>
"transaction"
.to_string
(),
Entity
::
Tuple
=>
"tuple"
.to_string
(),
Entity
::
Tuple
=>
"tuple"
.to_string
(),
...
@@ -341,3 +345,13 @@ impl<E: fmt::Debug> From<TransactionError<E>> for SbroadError {
...
@@ -341,3 +345,13 @@ impl<E: fmt::Debug> From<TransactionError<E>> for SbroadError {
)
)
}
}
}
}
impl
From
<
Error
>
for
SbroadError
{
fn
from
(
error
:
Error
)
->
Self
{
SbroadError
::
FailedTo
(
Action
::
Create
,
Some
(
Entity
::
Tarantool
),
format!
(
"{error:?}"
),
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment