File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,16 @@ func (n *Nuke) Run() error {
63
63
return err
64
64
}
65
65
66
+ if n .items .Count (ItemStateFailed ) > 0 && n .items .Count (ItemStateNew ) == 0 {
67
+ for _ , item := range n .items {
68
+ if item .State != ItemStateFailed {
69
+ continue
70
+ }
71
+ logrus .Error (fmt .Sprintf ("%s. %s." , item .Type , item .Reason ))
72
+ }
73
+ return fmt .Errorf ("failed" )
74
+ }
75
+
66
76
if n .items .Count (ItemStateNew ) == 0 {
67
77
fmt .Println ("No resource to delete." )
68
78
return nil
@@ -249,9 +259,9 @@ func (n *Nuke) HandleQueue() {
249
259
n .HandleRemove (item )
250
260
item .Print ()
251
261
case ItemStateFailed :
252
- // item.Resource will be nil if an exception was thrown while retrieving the resourceType's
253
- // items (I.E resourceTypes lister()), however we still pass down the reason and state so we
254
- // aren't ignoring these exceptions.
262
+ // item.Resource will be nil if an exception was thrown while retrieving cloudControl
263
+ // resourceType's items (I.E resourceTypes lister()), however we still pass down the
264
+ // reason and state so we aren't ignoring these exceptions.
255
265
if item .Resource != nil {
256
266
n .HandleRemove (item )
257
267
n .HandleWait (item , listCache )
Original file line number Diff line number Diff line change @@ -73,9 +73,6 @@ func (s *scanner) list(region *Region, resourceType string) {
73
73
return
74
74
}
75
75
76
- // check for this error "ThrottlingException: Rate exceeded"
77
- // TODO: if there is a throttling exception call lister(sess) again 3 times with exponential backoff.
78
- // or maybe try recursion and call s.list(region, resourceType)
79
76
awsErr , ok := err .(awserr.Error )
80
77
if ok && awsErr .Code () == "ThrottlingException" {
81
78
s .items <- & Item {
@@ -85,6 +82,8 @@ func (s *scanner) list(region *Region, resourceType string) {
85
82
Reason : err .Error (),
86
83
Type : resourceType ,
87
84
}
85
+ dump := util .Indent (fmt .Sprintf ("%v" , err ), " " )
86
+ log .Errorf ("Listing %s failed:\n %s" , resourceType , dump )
88
87
return
89
88
}
90
89
You can’t perform that action at this time.
0 commit comments