Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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-server
Commits
52881f3a
Verified
Commit
52881f3a
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: error handling for single entity retrieve
parent
3e927b86
No related branches found
No related tags found
2 merge requests
!44
Release 0.6
,
!43
Merge f-GRPC-main to dev
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
caosdb-proto
+1
-1
1 addition, 1 deletion
caosdb-proto
pom.xml
+1
-1
1 addition, 1 deletion
pom.xml
src/main/java/org/caosdb/server/grpc/EntityTransactionServiceImpl.java
+29
-0
29 additions, 0 deletions
.../org/caosdb/server/grpc/EntityTransactionServiceImpl.java
with
31 additions
and
2 deletions
caosdb-proto
@
3f867687
Subproject commit
12f072263c05208464b80c0124bde0396b100d86
Subproject commit
3f867687cc71e42e964051b35f856abf6b1c8f09
This diff is collapsed.
Click to expand it.
pom.xml
+
1
−
1
View file @
52881f3a
...
...
@@ -25,7 +25,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.caosdb
</groupId>
<artifactId>
caosdb-server
</artifactId>
<version>
0.5.0-GRPC0.0.
5
</version>
<version>
0.5.0-GRPC0.0.
6
</version>
<packaging>
jar
</packaging>
<name>
CaosDB Server
</name>
<scm>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/caosdb/server/grpc/EntityTransactionServiceImpl.java
+
29
−
0
View file @
52881f3a
...
...
@@ -2,6 +2,8 @@ package org.caosdb.server.grpc;
import
io.grpc.stub.StreamObserver
;
import
java.util.Iterator
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.UUID
;
import
org.apache.shiro.SecurityUtils
;
import
org.caosdb.api.entity.v1alpha1.ByIdRequest
;
...
...
@@ -14,6 +16,7 @@ import org.caosdb.api.entity.v1alpha1.RetrieveResponse;
import
org.caosdb.api.entity.v1alpha1.Version
;
import
org.caosdb.server.entity.EntityInterface
;
import
org.caosdb.server.entity.MagicTypes
;
import
org.caosdb.server.entity.Message
;
import
org.caosdb.server.entity.RetrieveEntity
;
import
org.caosdb.server.entity.container.ParentContainer
;
import
org.caosdb.server.entity.container.PropertyContainer
;
...
...
@@ -64,7 +67,33 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa
if
(
from
.
hasParents
())
{
builder
.
addAllParents
(
convert
(
from
.
getParents
()));
}
if
(
from
.
hasMessage
(
Message
.
MessageType
.
Error
.
toString
()))
{
builder
.
addAllErrors
(
convert
(
from
.
getMessages
(
Message
.
MessageType
.
Error
.
toString
())));
}
if
(
from
.
hasMessage
(
Message
.
MessageType
.
Warning
.
toString
()))
{
builder
.
addAllErrors
(
convert
(
from
.
getMessages
(
Message
.
MessageType
.
Warning
.
toString
())));
}
if
(
from
.
hasMessage
(
Message
.
MessageType
.
Info
.
toString
()))
{
builder
.
addAllErrors
(
convert
(
from
.
getMessages
(
Message
.
MessageType
.
Info
.
toString
())));
}
return
builder
.
build
();
}
private
Iterable
<?
extends
org
.
caosdb
.
api
.
entity
.
v1alpha1
.
Message
>
convert
(
final
List
<
Message
>
messages
)
{
final
List
<
org
.
caosdb
.
api
.
entity
.
v1alpha1
.
Message
>
result
=
new
LinkedList
<>();
for
(
final
Message
m
:
messages
)
{
result
.
add
(
convert
(
m
));
}
return
result
;
}
private
org
.
caosdb
.
api
.
entity
.
v1alpha1
.
Message
convert
(
final
Message
m
)
{
final
org
.
caosdb
.
api
.
entity
.
v1alpha1
.
Message
.
Builder
builder
=
org
.
caosdb
.
api
.
entity
.
v1alpha1
.
Message
.
newBuilder
();
builder
.
setCode
(
m
.
getCode
());
builder
.
setDescription
(
m
.
getDescription
());
return
builder
.
build
();
}
...
...
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