Using generated error types
This commit is contained in:
@ -27,6 +27,7 @@ var _ = Service("item", func() {
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
Response("NotFound", CodeNotFound)
|
||||
})
|
||||
})
|
||||
|
||||
@ -44,10 +45,11 @@ var _ = Service("item", func() {
|
||||
Method("createItem", func() {
|
||||
Payload(Item)
|
||||
Result(Item)
|
||||
Error("BadRequest")
|
||||
Error("AlreadyExists")
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
Response("AlreadyExists", CodeAlreadyExists)
|
||||
})
|
||||
})
|
||||
|
||||
@ -55,10 +57,10 @@ var _ = Service("item", func() {
|
||||
Payload(Item)
|
||||
Result(Item)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
Response("NotFound", CodeNotFound)
|
||||
})
|
||||
})
|
||||
|
||||
@ -68,12 +70,10 @@ var _ = Service("item", func() {
|
||||
})
|
||||
Result(Empty)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
Response("NotFound", CodeNotFound)
|
||||
Response("BadRequest", CodeInvalidArgument)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user