Skip to content

Commit

Permalink
Added handling for errors returned from the server
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkJaroski committed Aug 25, 2024
1 parent 4e676c5 commit 34a81ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -841,13 +841,17 @@ func authorizeApp() {
Interval int `json:"interval"`
UserCode string `json:"user_code"`
VerificationURI string `json:"verification_uri"`
Error string `json:"error"`
}

var resp DeviceCodeGrant
err = json.Unmarshal(resData, &resp)
if err != nil {
Log.Error("Error unmarshaling json:", err.Error())
}
if resp.Error != "" {
Log.Error(resp.Error)
}

fmt.Println("Please visit this URL and enter the code below " + resp.VerificationURI)
fmt.Println()
Expand Down

0 comments on commit 34a81ce

Please sign in to comment.