Not exiting multi-case upload process when one gens upload fails
raysloks opened this issue · comments
As mentioned in #3197, it'd be good to not exit the upload process entirely when singular Gens samples fail to upload to a duplicate key error.
I'm not entirely sure how to accomplish this in the best way. Would simply putting a try except CalledProcessError
somewhere like here
Line 45 in 985acfb
Hmm I think a try/except would be nice, but I would rather have it where the samples are being looped through. There could be benefits to having an error raised from GensAPI.load which is caught by the upload_to_gens method, say if you would want a method which uploads only a single sample. There it might make sense that an error is raised.
Hmmm, I might have misunderstood whoever originally noted this problem.
cg seems to already separate the cases here
Lines 116 to 121 in 985acfb
The command still exits with an error code, but it continues to upload other cases after an exception is caught.
I've taken a look at chanjo and genotype, and they both simply print a warning when there's a duplicate. However, they respect the re_upload/restart/force flag.
For consistency's sake I guess it might be best to, as you say, have upload_to_gens catch an exception, but then just print a warning, and to have Gens respect the re_upload/restart flag?
@raysloks Sounds good! Let's make it so.