From 124885e7a3a6d95c9eb799e087809085c56811de Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 4 Dec 2020 08:28:34 -0600 Subject: [PATCH 1/2] update template --- templates/client/api.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/client/api.mustache b/templates/client/api.mustache index c8e87f26..7002bc1d 100644 --- a/templates/client/api.mustache +++ b/templates/client/api.mustache @@ -109,7 +109,8 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, From 80804f8bda75b14335e5c086a16bc429bc874de5 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 4 Dec 2020 08:36:26 -0600 Subject: [PATCH 2/2] make gen --- client/api_account.go | 6 ++++-- client/api_block.go | 6 ++++-- client/api_call.go | 3 ++- client/api_construction.go | 24 ++++++++++++++++-------- client/api_events.go | 3 ++- client/api_mempool.go | 6 ++++-- client/api_network.go | 9 ++++++--- client/api_search.go | 3 ++- 8 files changed, 40 insertions(+), 20 deletions(-) diff --git a/client/api_account.go b/client/api_account.go index 15ac48fe..2de22018 100644 --- a/client/api_account.go +++ b/client/api_account.go @@ -111,7 +111,8 @@ func (a *AccountAPIService) AccountBalance( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -205,7 +206,8 @@ func (a *AccountAPIService) AccountCoins( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, diff --git a/client/api_block.go b/client/api_block.go index 73e9903e..53b7b85f 100644 --- a/client/api_block.go +++ b/client/api_block.go @@ -108,7 +108,8 @@ func (a *BlockAPIService) Block( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -205,7 +206,8 @@ func (a *BlockAPIService) BlockTransaction( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, diff --git a/client/api_call.go b/client/api_call.go index 5701d318..7acaebcb 100644 --- a/client/api_call.go +++ b/client/api_call.go @@ -111,7 +111,8 @@ func (a *CallAPIService) Call( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, diff --git a/client/api_construction.go b/client/api_construction.go index d14fa810..7ea8f560 100644 --- a/client/api_construction.go +++ b/client/api_construction.go @@ -103,7 +103,8 @@ func (a *ConstructionAPIService) ConstructionCombine( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -188,7 +189,8 @@ func (a *ConstructionAPIService) ConstructionDerive( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -273,7 +275,8 @@ func (a *ConstructionAPIService) ConstructionHash( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -365,7 +368,8 @@ func (a *ConstructionAPIService) ConstructionMetadata( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -451,7 +455,8 @@ func (a *ConstructionAPIService) ConstructionParse( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -542,7 +547,8 @@ func (a *ConstructionAPIService) ConstructionPayloads( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -631,7 +637,8 @@ func (a *ConstructionAPIService) ConstructionPreprocess( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -719,7 +726,8 @@ func (a *ConstructionAPIService) ConstructionSubmit( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, diff --git a/client/api_events.go b/client/api_events.go index 82da58a5..07743c8f 100644 --- a/client/api_events.go +++ b/client/api_events.go @@ -106,7 +106,8 @@ func (a *EventsAPIService) EventsBlocks( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, diff --git a/client/api_mempool.go b/client/api_mempool.go index 4cbc083b..f7a99697 100644 --- a/client/api_mempool.go +++ b/client/api_mempool.go @@ -101,7 +101,8 @@ func (a *MempoolAPIService) Mempool( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -191,7 +192,8 @@ func (a *MempoolAPIService) MempoolTransaction( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, diff --git a/client/api_network.go b/client/api_network.go index 6ab433f3..fcb6a96c 100644 --- a/client/api_network.go +++ b/client/api_network.go @@ -101,7 +101,8 @@ func (a *NetworkAPIService) NetworkList( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -188,7 +189,8 @@ func (a *NetworkAPIService) NetworkOptions( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, @@ -273,7 +275,8 @@ func (a *NetworkAPIService) NetworkStatus( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable, diff --git a/client/api_search.go b/client/api_search.go index 3228aee5..d3e1166b 100644 --- a/client/api_search.go +++ b/client/api_search.go @@ -106,7 +106,8 @@ func (a *SearchAPIService) SearchTransactions( return nil, &v, fmt.Errorf("%+v", v) case _nethttp.StatusBadGateway, _nethttp.StatusServiceUnavailable, - _nethttp.StatusGatewayTimeout: + _nethttp.StatusGatewayTimeout, + _nethttp.StatusRequestTimeout: return nil, nil, fmt.Errorf( "%w: code: %d body: %s", ErrRetriable,