@@ -148,15 +148,17 @@ func mount(cmd *cobra.Command, args []string) (err error) {
148
148
149
149
client := sdl .NewClient (endpoint , location , ngc , types )
150
150
var accessions []* fuseralib.Accession
151
+ var rootErr []byte
151
152
if ! eager {
152
153
dot := 2000
153
154
i := 0
154
155
for dot < len (accs ) {
155
156
aa , err := client .GetMetadata (accs [i :dot ])
156
157
if err != nil {
157
- fmt .Println (err .Error ())
158
- fmt .Println ("List of accessions that failed in this batch:" )
159
- fmt .Println (accs [i :dot ])
158
+ rootErr = append (rootErr , []byte (fmt .Sprintln (err .Error ()))... )
159
+ rootErr = append (rootErr , []byte ("List of accessions that failed in this batch:\n " )... )
160
+ rootErr = append (rootErr , []byte (fmt .Sprintln (accs [i :dot ]))... )
161
+ fmt .Println (string (rootErr ))
160
162
} else {
161
163
accessions = append (accessions , aa ... )
162
164
}
@@ -165,9 +167,10 @@ func mount(cmd *cobra.Command, args []string) (err error) {
165
167
}
166
168
aa , err := client .GetMetadata (accs [i :])
167
169
if err != nil {
168
- fmt .Println (err .Error ())
169
- fmt .Println ("List of accessions that failed in this batch:" )
170
- fmt .Println (accs [i :])
170
+ rootErr = append (rootErr , []byte (fmt .Sprintln (err .Error ()))... )
171
+ rootErr = append (rootErr , []byte ("List of accessions that failed in this batch:\n " )... )
172
+ rootErr = append (rootErr , []byte (fmt .Sprintln (accs [i :]))... )
173
+ fmt .Println (string (rootErr ))
171
174
} else {
172
175
accessions = append (accessions , aa ... )
173
176
}
@@ -177,9 +180,10 @@ func mount(cmd *cobra.Command, args []string) (err error) {
177
180
for dot < len (accs ) {
178
181
aa , err := client .GetSignedURL (accs [i :dot ])
179
182
if err != nil {
180
- fmt .Println (err .Error ())
181
- fmt .Println ("List of accessions that failed in this batch:" )
182
- fmt .Println (accs [i :dot ])
183
+ rootErr = append (rootErr , []byte (fmt .Sprintln (err .Error ()))... )
184
+ rootErr = append (rootErr , []byte ("List of accessions that failed in this batch:\n " )... )
185
+ rootErr = append (rootErr , []byte (fmt .Sprintln (accs [i :dot ]))... )
186
+ fmt .Println (string (rootErr ))
183
187
} else {
184
188
accessions = append (accessions , aa ... )
185
189
}
@@ -188,13 +192,18 @@ func mount(cmd *cobra.Command, args []string) (err error) {
188
192
}
189
193
aa , err := client .GetSignedURL (accs [i :])
190
194
if err != nil {
191
- fmt .Println (err .Error ())
192
- fmt .Println ("List of accessions that failed in this batch:" )
193
- fmt .Println (accs [i :])
195
+ rootErr = append (rootErr , []byte (fmt .Sprintln (err .Error ()))... )
196
+ rootErr = append (rootErr , []byte ("List of accessions that failed in this batch:\n " )... )
197
+ rootErr = append (rootErr , []byte (fmt .Sprintln (accs [i :]))... )
198
+ fmt .Println (string (rootErr ))
194
199
} else {
195
200
accessions = append (accessions , aa ... )
196
201
}
197
202
}
203
+ if len (accessions ) == 0 {
204
+ fmt .Println ("It seems like none of the accessions were successful, fusera is shutting down." )
205
+ os .Exit (1 )
206
+ }
198
207
//
199
208
opt := & fuseralib.Options {
200
209
Signer : client ,
0 commit comments