Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Octave library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
caosdb
Software
CaosDB Octave library
Commits
72dfcb1f
Commit
72dfcb1f
authored
3 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Error when retrieving nonexisting entities.
parent
a9f7a6fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Full functionality of libcaosdb
Pipeline
#12517
passed with warnings
3 years ago
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-octaveinttest
#12520
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib/maoxdb.cpp
+6
-5
6 additions, 5 deletions
src/lib/maoxdb.cpp
src/private/maox_retrieve.cpp
+1
-1
1 addition, 1 deletion
src/private/maox_retrieve.cpp
with
7 additions
and
6 deletions
src/lib/maoxdb.cpp
+
6
−
5
View file @
72dfcb1f
...
@@ -52,13 +52,14 @@ auto mxFromCaosDBMessages(const ce::Messages &messages) -> mxArray *;
...
@@ -52,13 +52,14 @@ auto mxFromCaosDBMessages(const ce::Messages &messages) -> mxArray *;
*/
*/
auto
transactionStatusToMessage
(
const
caosdb
::
transaction
::
Transaction
*
const
trans
)
auto
transactionStatusToMessage
(
const
caosdb
::
transaction
::
Transaction
*
const
trans
)
->
std
::
pair
<
string
,
string
>
{
->
std
::
pair
<
string
,
string
>
{
auto
status
=
trans
->
GetStatus
();
const
auto
&
status
=
trans
->
GetStatus
();
auto
code
=
status
.
GetCode
();
const
auto
&
code
=
status
.
GetCode
();
// Don't raise errors if it's only transaction errors (put into entity messages).
// Don't raise errors if it's only transaction errors (put into entity
if
(
!
status
.
IsError
()
||
code
==
caosdb
::
StatusCode
::
GENERIC_TRANSACTION_ERROR
)
{
// messages).
if
(
!
status
.
IsError
())
{
// || code == caosdb::StatusCode::GENERIC_TRANSACTION_ERROR) {
return
std
::
pair
<
string
,
string
>
();
return
std
::
pair
<
string
,
string
>
();
}
}
string
id
=
std
::
to_string
(
code
);
string
id
=
string
(
"maoxdb:"
)
+
std
::
to_string
(
code
);
string
text
=
status
.
GetDescription
();
string
text
=
status
.
GetDescription
();
return
std
::
pair
<
string
,
string
>
(
id
,
text
);
return
std
::
pair
<
string
,
string
>
(
id
,
text
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/private/maox_retrieve.cpp
+
1
−
1
View file @
72dfcb1f
...
@@ -91,7 +91,7 @@ void mexFunction(int /*nlhs*/, mxArray *plhs[], int nrhs, const mxArray *prhs[])
...
@@ -91,7 +91,7 @@ void mexFunction(int /*nlhs*/, mxArray *plhs[], int nrhs, const mxArray *prhs[])
transaction
->
RetrieveById
(
id
);
transaction
->
RetrieveById
(
id
);
}
}
transaction
->
ExecuteAsynchronously
();
transaction
->
ExecuteAsynchronously
();
auto
t_stat
=
transaction
->
WaitForIt
();
const
auto
&
t_stat
=
transaction
->
WaitForIt
();
maoxdb
::
throwOctExceptionIfError
(
transaction
.
get
());
maoxdb
::
throwOctExceptionIfError
(
transaction
.
get
());
// Status must be OK or GENERIC_TRANSACTION_ERROR now.
// Status must be OK or GENERIC_TRANSACTION_ERROR now.
const
auto
&
results
=
transaction
->
GetResultSet
();
const
auto
&
results
=
transaction
->
GetResultSet
();
...
...
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