mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 05:45:37 +08:00
Add error handling to upload's check_zip.
This commit is contained in:
@@ -99,7 +99,7 @@ class Bam( Binary ):
|
||||
stderr_name = tempfile.NamedTemporaryFile( prefix = "bam_index_stderr" ).name
|
||||
command = 'samtools index %s %s' % ( dataset.file_name, index_file.file_name )
|
||||
proc = subprocess.Popen( args=command, shell=True, stderr=open( stderr_name, 'wb' ) )
|
||||
|
||||
proc.wait()
|
||||
#Did index succeed?
|
||||
stderr = open( stderr_name ).read().strip()
|
||||
if stderr:
|
||||
|
||||
@@ -118,7 +118,10 @@ def check_zip( temp_name ):
|
||||
# 1. Archives can only include .ab1, .scf or .txt files
|
||||
# 2. All file extensions within an archive must be the same
|
||||
name = zip_file.namelist()[0]
|
||||
test_ext = name.split( "." )[1].strip().lower()
|
||||
try:
|
||||
test_ext = name.split( "." )[1].strip().lower()
|
||||
except:
|
||||
return ( True, False, None )
|
||||
if not ( test_ext in unsniffable_binary_formats or test_ext == 'txt' ):
|
||||
return ( True, False, test_ext )
|
||||
for name in zip_file.namelist():
|
||||
|
||||
Reference in New Issue
Block a user