@@ -71,7 +71,7 @@ func (c *MeshStackProviderClient) ReadProject(workspace string, name string) (*M
7171 return nil , nil
7272 }
7373
74- if res . StatusCode != 200 {
74+ if ! isSuccessHTTPStatus ( res ) {
7575 return nil , fmt .Errorf ("unexpected status code: %d, %s" , res .StatusCode , data )
7676 }
7777
@@ -119,7 +119,7 @@ func (c *MeshStackProviderClient) ReadProjects(workspaceIdentifier string, payme
119119 return nil , fmt .Errorf ("failed to read response body: %w" , err )
120120 }
121121
122- if res . StatusCode != http . StatusOK {
122+ if ! isSuccessHTTPStatus ( res ) {
123123 return nil , fmt .Errorf ("unexpected status code: %d, %s" , res .StatusCode , data )
124124 }
125125
@@ -178,7 +178,7 @@ func (c *MeshStackProviderClient) CreateProject(project *MeshProjectCreate) (*Me
178178 return nil , err
179179 }
180180
181- if res . StatusCode != 201 {
181+ if ! isSuccessHTTPStatus ( res ) {
182182 return nil , fmt .Errorf ("unexpected status code: %d, %s" , res .StatusCode , data )
183183 }
184184
@@ -219,7 +219,7 @@ func (c *MeshStackProviderClient) UpdateProject(project *MeshProjectCreate) (*Me
219219 return nil , err
220220 }
221221
222- if res . StatusCode != 200 {
222+ if ! isSuccessHTTPStatus ( res ) {
223223 return nil , fmt .Errorf ("unexpected status code: %d, %s" , res .StatusCode , data )
224224 }
225225
0 commit comments