File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,18 @@ package main
4
4
import (
5
5
"context"
6
6
"errors"
7
- "github.com/gosuri/uilive"
8
- "github.com/larrabee/s3sync/pipeline"
9
- "github.com/larrabee/s3sync/storage"
10
- "github.com/sirupsen/logrus"
11
7
"net/http"
12
8
_ "net/http/pprof"
13
9
"os"
14
10
"os/signal"
15
11
"runtime"
16
12
"syscall"
13
+
14
+ "github.com/gosuri/uilive"
15
+ "github.com/sirupsen/logrus"
16
+
17
+ "github.com/larrabee/s3sync/pipeline"
18
+ "github.com/larrabee/s3sync/storage"
17
19
)
18
20
19
21
var cli argsParsed
Original file line number Diff line number Diff line change @@ -3,10 +3,12 @@ package storage
3
3
import (
4
4
"context"
5
5
"errors"
6
+ "os"
7
+
6
8
"github.com/aws/aws-sdk-go/aws/awserr"
7
9
"github.com/aws/aws-sdk-go/aws/request"
8
10
"github.com/aws/aws-sdk-go/service/s3"
9
- "os "
11
+ "github.com/gophercloud/gophercloud "
10
12
)
11
13
12
14
func IsErrNotExist (err error ) bool {
@@ -20,6 +22,12 @@ func IsErrNotExist(err error) bool {
20
22
if errors .Is (err , os .ErrNotExist ) {
21
23
return true
22
24
}
25
+
26
+ var sErr gophercloud.ErrDefault404
27
+ if errors .As (err , & sErr ) {
28
+ return true
29
+ }
30
+
23
31
return false
24
32
}
25
33
@@ -34,6 +42,12 @@ func IsErrPermission(err error) bool {
34
42
if errors .Is (err , os .ErrPermission ) {
35
43
return true
36
44
}
45
+
46
+ var sErr gophercloud.ErrDefault403
47
+ if errors .As (err , & sErr ) {
48
+ return true
49
+ }
50
+
37
51
return false
38
52
}
39
53
You can’t perform that action at this time.
0 commit comments