diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index 2c3905d55..3bc99bb93 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -139,13 +139,10 @@ func init() { } sites := siteResponse{} - resp, err := srv.CallJSON(&opts, nil, &sites) + _, err := srv.CallJSON(&opts, nil, &sites) if err != nil { log.Fatalf("Failed to query available sites: %v", err) } - if resp.StatusCode != 200 { - log.Fatalf("Failed to query available sites: Got HTTP error code %d", resp.StatusCode) - } if len(sites.Sites) == 0 { log.Fatalf("Search for '%s' returned no results", searchTerm) @@ -171,13 +168,10 @@ func init() { // query Microsoft Graph if finalDriveID == "" { drives := drivesResponse{} - resp, err := srv.CallJSON(&opts, nil, &drives) + _, err := srv.CallJSON(&opts, nil, &drives) if err != nil { log.Fatalf("Failed to query available drives: %v", err) } - if resp.StatusCode != 200 { - log.Fatalf("Failed to query available drives: Got HTTP error code %d", resp.StatusCode) - } if len(drives.Drives) == 0 { log.Fatalf("No drives found") @@ -196,13 +190,10 @@ func init() { RootURL: graphURL, Path: "/drives/" + finalDriveID + "/root"} var rootItem api.Item - resp, err := srv.CallJSON(&opts, nil, &rootItem) + _, err = srv.CallJSON(&opts, nil, &rootItem) if err != nil { log.Fatalf("Failed to query root for drive %s: %v", finalDriveID, err) } - if resp.StatusCode != 200 { - log.Fatalf("Failed to query root for drive %s: Got HTTP error code %d", finalDriveID, resp.StatusCode) - } fmt.Printf("Found drive '%s' of type '%s', URL: %s\nIs that okay?\n", rootItem.Name, rootItem.ParentReference.DriveType, rootItem.WebURL) // This does not work, YET :)