Browse Source

Checking status code of login connection

Piotr Czajkowski 7 years ago
parent
commit
b2718290be
1 changed files with 3 additions and 0 deletions
  1. 3 0
      app.go

+ 3 - 0
app.go

@@ -76,6 +76,9 @@ func (app *Application) Login() {
 	if err != nil {
 		log.Fatalf("Error logging in: %v", err)
 	}
+	if resp.StatusCode != 200 {
+		log.Fatalf("Error logging in: %v", resp.Status)
+	}
 	defer resp.Body.Close()
 
 	JSONDecoder(resp.Body, &app)