Skip to content

Commit

Permalink
Only add documentation about error types if there are actual soap
Browse files Browse the repository at this point in the history
faults
  • Loading branch information
c4milo committed Aug 31, 2014
1 parent 053255e commit 96085c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion generator/operations_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,26 @@ var opsTmpl = `
}
{{range .Operations}}
{{$faults := len .Faults}}
{{$requestType := findType .Input.Message}}
{{$soapAction := findSoapAction .Name $portType}}
{{$output := findType .Output.Message}}
{{if gt $faults 0}}
/**
* Error can be either of the following types:
* {{range .Faults}}
* - {{.Name}} {{.Doc}}{{end}}
*/
{{end}}
func (service *{{$portType}}) {{makePublic .Name}} (request *{{$requestType}}) (*{{$output}}, error) {
response := &{{$output}}{}
err := service.client.Call("{{$soapAction}}", request, response)
if err != nil {
return nil, err
}
return response, nil
return response, nil
}
{{end}}
{{end}}
Expand Down

0 comments on commit 96085c4

Please sign in to comment.