Skip to content

Commit f27c230

Browse files
committed
just raise error
1 parent 6a553f6 commit f27c230

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

qiita_ware/commands.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,9 @@ def submit_EBI(preprocessed_data_id, action, send):
6464
for cmd in ebi_submission.generate_send_sequences_cmd():
6565
stdout, stderr, rv = system_call(cmd)
6666
if rv != 0:
67-
le = LogEntry.create(
68-
'Fatal', "Command: %s\nError: %s\n" % (cmd, stderr),
69-
info={'ebi_submission': preprocessed_data_id})
70-
ebi_submission.study.ebi_submission_status = (
71-
"failed: ASCP submission, log id: %d" % le.id)
72-
raise ComputeError("EBI Submission failed! Log id: "
73-
"%d" % le.id)
67+
error_msg = ("Error:\nStd output:%s\nStd error:%s" % (
68+
stdout, stderr))
69+
raise EBISubmissionError(error_msg)
7470
open(ebi_submission.ascp_reply, 'a').write(
7571
'stdout:\n%s\n\nstderr: %s' % (stdout, stderr))
7672
environ['ASPERA_SCP_PASS'] = old_ascp_pass
@@ -86,13 +82,9 @@ def submit_EBI(preprocessed_data_id, action, send):
8682
"%d" % preprocessed_data_id))
8783
xml_content, stderr, rv = system_call(xmls_cmds)
8884
if rv != 0:
89-
xml_content = ''
90-
le = LogEntry.create(
91-
'Fatal', "Command: %s\nError: %s\n" % (cmd, stderr),
92-
info={'ebi_submission': preprocessed_data_id})
93-
ebi_submission.study.ebi_submission_status = (
94-
"failed: XML submission, log id: %d" % le.id)
95-
raise ComputeError("EBI Submission failed! Log id: %d" % le.id)
85+
error_msg = ("Error:\nStd output:%s\nStd error:%s" % (
86+
xml_content, stderr))
87+
raise EBISubmissionError(error_msg)
9688
else:
9789
LogEntry.create('Runtime',
9890
('Submission of sequences of pre_processed_id: '
@@ -190,7 +182,8 @@ def submit_VAMPS(artifact_id):
190182
qiita_config.vamps_url))
191183
obs, stderr, rv = system_call(cmd)
192184
if rv != 0:
193-
raise ComputeError('Error: \nstderr: %s' % stderr)
185+
error_msg = ("Error:\nStd output:%s\nStd error:%s" % (obs, stderr))
186+
raise ComputeError(error_msg)
194187

195188
exp = ("<html>\n<head>\n<title>Process Uploaded File</title>\n</head>\n"
196189
"<body>\n</body>\n</html>")

0 commit comments

Comments
 (0)