diff --git a/client/main.go b/client/main.go
index 10a3646b0d607ec3b70a14686a021d6c2e3e48a1..c5f28f9c309a4d4d570eca4679cc691bb2d54a35 100644
--- a/client/main.go
+++ b/client/main.go
@@ -46,12 +46,12 @@ func send(s []byte, token string) (*lib.SignResponse, error) {
 	req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token))
 	client := &http.Client{}
 	resp, err := client.Do(req)
-	if resp.StatusCode != http.StatusOK {
-		return nil, fmt.Errorf("Bad response from server: %s", resp.Status)
-	}
 	if err != nil {
 		return nil, err
 	}
+	if resp.StatusCode != http.StatusOK {
+		return nil, fmt.Errorf("Bad response from server: %s", resp.Status)
+	}
 	defer resp.Body.Close()
 	body, err := ioutil.ReadAll(resp.Body)
 	if err != nil {