From 96a05516f9eb2e650caf31263657f2a7dbcb643c Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 11 Nov 2018 10:40:13 +0000 Subject: [PATCH] acd,box,onedrive,pcloud: remote log.Fatal from NewFs And replace with error returns. --- backend/amazonclouddrive/amazonclouddrive.go | 2 +- backend/box/box.go | 2 +- backend/onedrive/onedrive.go | 4 ++-- backend/pcloud/pcloud.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/amazonclouddrive/amazonclouddrive.go b/backend/amazonclouddrive/amazonclouddrive.go index 9c5692c78..12858a20e 100644 --- a/backend/amazonclouddrive/amazonclouddrive.go +++ b/backend/amazonclouddrive/amazonclouddrive.go @@ -264,7 +264,7 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) { } oAuthClient, ts, err := oauthutil.NewClientWithBaseClient(name, m, acdConfig, baseClient) if err != nil { - log.Fatalf("Failed to configure Amazon Drive: %v", err) + return nil, errors.Wrap(err, "failed to configure Amazon Drive") } c := acd.NewClient(oAuthClient) diff --git a/backend/box/box.go b/backend/box/box.go index 34688cc34..1837339aa 100644 --- a/backend/box/box.go +++ b/backend/box/box.go @@ -252,7 +252,7 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) { root = parsePath(root) oAuthClient, ts, err := oauthutil.NewClient(name, m, oauthConfig) if err != nil { - log.Fatalf("Failed to configure Box: %v", err) + return nil, errors.Wrap(err, "failed to configure Box") } f := &Fs{ diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index e5e3290c9..1223be91b 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -404,13 +404,13 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) { } if opt.DriveID == "" || opt.DriveType == "" { - log.Fatalf("Unable to get drive_id and drive_type. If you are upgrading from older versions of rclone, please run `rclone config` and re-configure this backend.") + return nil, errors.New("unable to get drive_id and drive_type - if you are upgrading from older versions of rclone, please run `rclone config` and re-configure this backend") } root = parsePath(root) oAuthClient, ts, err := oauthutil.NewClient(name, m, oauthConfig) if err != nil { - log.Fatalf("Failed to configure OneDrive: %v", err) + return nil, errors.Wrap(err, "failed to configure OneDrive") } f := &Fs{ diff --git a/backend/pcloud/pcloud.go b/backend/pcloud/pcloud.go index 1a97105a4..fdd57b02b 100644 --- a/backend/pcloud/pcloud.go +++ b/backend/pcloud/pcloud.go @@ -246,7 +246,7 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) { root = parsePath(root) oAuthClient, ts, err := oauthutil.NewClient(name, m, oauthConfig) if err != nil { - log.Fatalf("Failed to configure Pcloud: %v", err) + return nil, errors.Wrap(err, "failed to configure Pcloud") } f := &Fs{