Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
micahlmartin committed Mar 17, 2022
1 parent 86e2f94 commit 2a9dd80
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions harness/nextgen/api_pipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,36 @@ func (a *PipelinesApiService) GetPipeline(ctx context.Context, accountIdentifier
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v Failure
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 403 {
var v Failure
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 || localVarHttpResponse.StatusCode == 405 {
var v Failure
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v ModelError
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
Expand Down

0 comments on commit 2a9dd80

Please sign in to comment.