aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader
diff options
context:
space:
mode:
Diffstat (limited to 'bh20simplewebuploader')
-rw-r--r--bh20simplewebuploader/main.py7
-rw-r--r--bh20simplewebuploader/templates/error.html5
2 files changed, 9 insertions, 3 deletions
diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py
index 81f2ef9..693e4fd 100644
--- a/bh20simplewebuploader/main.py
+++ b/bh20simplewebuploader/main.py
@@ -3,6 +3,7 @@ import tempfile
import shutil
import subprocess
import os
+import sys
import re
import string
import yaml
@@ -250,12 +251,14 @@ def receive_files():
error_message="You did not include metadata."), 403)
# Try and upload files to Arvados using the sequence uploader CLI
- result = subprocess.run(['bh20-seq-uploader', fasta_dest, metadata_dest],
+
+ result = subprocess.run(['python3','bh20sequploader/main.py', fasta_dest, metadata_dest],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.returncode != 0:
# It didn't work. Complain.
- error_message="Upload failed. Uploader returned {} and said:\n{}".format(result.returncode, result.stderr)
+ error_message="Uploader returned value {} and said:".format(result.returncode) + str(result.stderr.decode('utf-8'))
+ print(error_message, file=sys.stderr)
return (render_template('error.html', error_message=error_message), 403)
else:
# It worked. Say so.
diff --git a/bh20simplewebuploader/templates/error.html b/bh20simplewebuploader/templates/error.html
index c2ab0a4..b1d9402 100644
--- a/bh20simplewebuploader/templates/error.html
+++ b/bh20simplewebuploader/templates/error.html
@@ -9,7 +9,10 @@
<h1>Upload Failed</h1>
<hr>
<p>
- Your upload has failed. {{error_message}}
+ Your upload has failed.
+ <pre>
+ {{error_message|safe}}
+ </pre>
</p>
<p>
<a href="/">Click here to try again.</a>