Skip to content

Commit 96085c4

Browse files
committed
Only add documentation about error types if there are actual soap
faults
1 parent 053255e commit 96085c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

generator/operations_tmpl.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,26 @@ var opsTmpl = `
1616
}
1717
1818
{{range .Operations}}
19+
{{$faults := len .Faults}}
1920
{{$requestType := findType .Input.Message}}
2021
{{$soapAction := findSoapAction .Name $portType}}
2122
{{$output := findType .Output.Message}}
23+
24+
{{if gt $faults 0}}
2225
/**
2326
* Error can be either of the following types:
2427
* {{range .Faults}}
2528
* - {{.Name}} {{.Doc}}{{end}}
2629
*/
30+
{{end}}
2731
func (service *{{$portType}}) {{makePublic .Name}} (request *{{$requestType}}) (*{{$output}}, error) {
2832
response := &{{$output}}{}
2933
err := service.client.Call("{{$soapAction}}", request, response)
3034
if err != nil {
3135
return nil, err
3236
}
3337
34-
return response, nil
38+
return response, nil
3539
}
3640
{{end}}
3741
{{end}}

0 commit comments

Comments
 (0)