Using generated error types
This commit is contained in:
1 parent
3511a4f022
commit
9dc9e6b031
7 files changed
+45
-73
No files matched your search
@@ -24,12 +24,10 @@ var _ = Service("character", func() {
|
||||
})
|
||||
Result(Character)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
Response("NotFound", CodeNotFound)
|
||||
Response("BadRequest", CodeInvalidArgument)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -45,13 +43,13 @@ var _ = Service("character", func() {
|
||||
Method("createCharacter", func() {
|
||||
Payload(Character)
|
||||
Result(Character)
|
||||
Error("BadRequest")
|
||||
Error("NotFound")
|
||||
Error("AlreadyExists")
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
Response("NotFound", CodeNotFound)
|
||||
Response("BadRequest", CodeInvalidArgument)
|
||||
Response("AlreadyExists", CodeAlreadyExists)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -59,12 +57,10 @@ var _ = Service("character", func() {
|
||||
Payload(Character)
|
||||
Result(Character)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
Response("NotFound", CodeNotFound)
|
||||
Response("BadRequest", CodeInvalidArgument)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -74,12 +70,10 @@ var _ = Service("character", func() {
|
||||
})
|
||||
Result(Empty)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
Response("NotFound", CodeNotFound)
|
||||
Response("BadRequest", CodeInvalidArgument)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user