@@ -66,7 +66,7 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, ls dag.LinkService, pn pin.
66
66
err := bs .DeleteBlock (k )
67
67
if err != nil {
68
68
errors = true
69
- output <- Result {Error : & CouldNotDeleteBlockError {k , err }}
69
+ output <- Result {Error : & CannotDeleteBlockError {k , err }}
70
70
//log.Errorf("Error removing key from blockstore: %s", err)
71
71
// continue as error is non-fatal
72
72
continue loop
@@ -82,7 +82,7 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, ls dag.LinkService, pn pin.
82
82
}
83
83
}
84
84
if errors {
85
- output <- Result {Error : ErrCouldNotDeleteSomeBlocks }
85
+ output <- Result {Error : ErrCannotDeleteSomeBlocks }
86
86
}
87
87
}()
88
88
@@ -112,7 +112,7 @@ func ColoredSet(ctx context.Context, pn pin.Pinner, ls dag.LinkService, bestEffo
112
112
links , err := ls .GetLinks (ctx , cid )
113
113
if err != nil {
114
114
errors = true
115
- output <- Result {Error : & CouldNotFetchLinksError {cid , err }}
115
+ output <- Result {Error : & CannotFetchLinksError {cid , err }}
116
116
}
117
117
return links , nil
118
118
}
@@ -126,7 +126,7 @@ func ColoredSet(ctx context.Context, pn pin.Pinner, ls dag.LinkService, bestEffo
126
126
links , err := ls .GetLinks (ctx , cid )
127
127
if err != nil && err != dag .ErrNotFound {
128
128
errors = true
129
- output <- Result {Error : & CouldNotFetchLinksError {cid , err }}
129
+ output <- Result {Error : & CannotFetchLinksError {cid , err }}
130
130
}
131
131
return links , nil
132
132
}
@@ -147,30 +147,30 @@ func ColoredSet(ctx context.Context, pn pin.Pinner, ls dag.LinkService, bestEffo
147
147
}
148
148
149
149
if errors {
150
- return nil , ErrCouldNotFetchAllLinks
151
- } else {
152
- return gcs , nil
150
+ return nil , ErrCannotFetchAllLinks
153
151
}
152
+
153
+ return gcs , nil
154
154
}
155
155
156
- var ErrCouldNotFetchAllLinks = errors .New ("garbage collection aborted: could not retrieve some links" )
156
+ var ErrCannotFetchAllLinks = errors .New ("garbage collection aborted: could not retrieve some links" )
157
157
158
- var ErrCouldNotDeleteSomeBlocks = errors .New ("garbage collection incomplete: could not delete some blocks" )
158
+ var ErrCannotDeleteSomeBlocks = errors .New ("garbage collection incomplete: could not delete some blocks" )
159
159
160
- type CouldNotFetchLinksError struct {
160
+ type CannotFetchLinksError struct {
161
161
Key * cid.Cid
162
162
Err error
163
163
}
164
164
165
- func (e * CouldNotFetchLinksError ) Error () string {
165
+ func (e * CannotFetchLinksError ) Error () string {
166
166
return fmt .Sprintf ("could not retrieve links for %s: %s" , e .Key , e .Err )
167
167
}
168
168
169
- type CouldNotDeleteBlockError struct {
169
+ type CannotDeleteBlockError struct {
170
170
Key * cid.Cid
171
171
Err error
172
172
}
173
173
174
- func (e * CouldNotDeleteBlockError ) Error () string {
174
+ func (e * CannotDeleteBlockError ) Error () string {
175
175
return fmt .Sprintf ("could not remove %s: %s" , e .Key , e .Err )
176
176
}
0 commit comments