Revert "[GO][Client] return GenericOpenAPIError instead of error in Execute() (#8137)" (#8427)

This reverts commit 1562afea39.
This commit is contained in:
William Cheng
2021-01-14 13:59:21 +08:00
committed by GitHub
parent 2b7ae4fa46
commit 22ac8faec7
42 changed files with 898 additions and 1478 deletions

View File

@@ -36,7 +36,7 @@ func main() {
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UsageApi.AnyKey(context.Background()).Execute()
if err.Error() != "" {
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.AnyKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
@@ -97,7 +97,7 @@ func main() {
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UsageApi.BothKeys(context.Background()).Execute()
if err.Error() != "" {
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.BothKeys``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
@@ -158,7 +158,7 @@ func main() {
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UsageApi.KeyInHeader(context.Background()).Execute()
if err.Error() != "" {
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.KeyInHeader``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
@@ -219,7 +219,7 @@ func main() {
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UsageApi.KeyInQuery(context.Background()).Execute()
if err.Error() != "" {
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.KeyInQuery``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}