Skip to content

Commit

Permalink
Better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
boppreh committed May 4, 2014
1 parent ca71de5 commit 71e557e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion steamgrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ func GetProfile(username string) (string, error) {
return "", err
}

if response.StatusCode >= 400 {
return "", errors.New("Profile not found. Make sure you have a public Steam profile.")
}

contentBytes, err := ioutil.ReadAll(response.Body)
response.Body.Close()
if err != nil {
Expand Down Expand Up @@ -356,7 +360,7 @@ func GetSteamInstallation() (path string, err error) {
return programFilesDir, nil
}

return "", errors.New("Could not find Steam installation folder.")
return "", errors.New("Could not find Steam installation folder. You can drag and drop the Steam folder into `steamgrid.exe` for a manual override.")
}

// Prints a progress bar, overriding the previous line. It looks like this:
Expand Down Expand Up @@ -409,6 +413,9 @@ func main() {
if err != nil {
errorAndExit(err)
}
if len(users) == 0 {
errorAndExit(errors.New("No users found. Have you used Steam before in this computer?"))
}

for _, user := range users {
fmt.Printf("Found user %v. Fetching game list from public profile...\n\n\n", user.Name)
Expand Down

0 comments on commit 71e557e

Please sign in to comment.