Skip to content

Commit 23259ba

Browse files
committed
fix: return error when postForm() is not successful
1 parent 512bd61 commit 23259ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/renkuapi/auth.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ func (auth *RenkuApiAuth) postForm(ctx context.Context, url string, data url.Val
361361
return resp, parseErr
362362
}
363363

364+
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
365+
// TODO: try to get the error from the response
366+
return resp, fmt.Errorf("got non successful response '%s'", resp.Status)
367+
}
368+
364369
return resp, nil
365370
}
366371

0 commit comments

Comments
 (0)