diff options
author | Pjotr Prins | 2020-04-13 10:29:31 -0500 |
---|---|---|
committer | Pjotr Prins | 2020-04-13 10:29:31 -0500 |
commit | f1b4e9950120224e0631bb86309590dfb661f2b1 (patch) | |
tree | 38f4f77eabb64fd02b16c99fb748b0a5189c7a40 /bh20simplewebuploader | |
parent | 7f78b5ed840095cb8d5c48dcb02c53400973fe13 (diff) | |
download | bh20-seq-resource-f1b4e9950120224e0631bb86309590dfb661f2b1.tar.gz bh20-seq-resource-f1b4e9950120224e0631bb86309590dfb661f2b1.tar.lz bh20-seq-resource-f1b4e9950120224e0631bb86309590dfb661f2b1.zip |
Format stack dump in output
Diffstat (limited to 'bh20simplewebuploader')
-rw-r--r-- | bh20simplewebuploader/main.py | 7 | ||||
-rw-r--r-- | bh20simplewebuploader/templates/error.html | 5 |
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> |