Skip to content

Commit

Permalink
Fix error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Garanzha committed Jan 23, 2019
1 parent 304b29e commit b34735d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions generator/plugins/proto2gql/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (g Proto2GraphQL) serviceMethod(sc ServiceConfig, cfg MethodConfig, file *p

if len(method.OutputMessage.Fields) == 1 && !cfg.UnwrapResponseField {
fmt.Printf(
"Suggestion: service `%s` method `%s` in file `%s` has 1 output argument. Can be unwrapped.\n",
"Suggestion: service `%s` method `%s` in file `%s` has 1 output field. Can be unwrapped.\n",
method.Service.Name,
method.Name,
file.File.FilePath,
Expand Down Expand Up @@ -261,7 +261,7 @@ func (g Proto2GraphQL) addDataLoaderProvider(sc ServiceConfig, cfg MethodConfig,
_, ok := method.OutputMessage.Fields[0].Type.(*parser.Message)

if !ok {
return errors.New("OutputMessage field must be message")
return errors.Errorf("can't unwrap %s method. Response must be message", method.Name)
}

outProtoType = method.OutputMessage.Fields[0].Type.(*parser.Message).Fields[0]
Expand Down

0 comments on commit b34735d

Please sign in to comment.