Prints error messages in terminal if job submission fails#6
Prints error messages in terminal if job submission fails#6ManavalanG wants to merge 2 commits intobrentp:masterfrom
Conversation
|
don't you think it should still raise an exception if the job doesn't submit? |
|
My bad, did you mean to say slurmpy already does this? |
|
well, before, the exception was unchecked, but raised (by python); now, you catch the exception but don't re-raise it. how about raise e after the printed messages? |
|
Turns out slurmpy already deals with error messages as expected. I use slurmpy to submit Snakemake jobs. When snakemake is run in dryrun mode, its error messages get redirected to stdout (instead of stdout), while those same errors get redirected to stderr when NOT in dryrun mode. I just realized this "gotcha", which makes However, I would still like to go ahead with the suggestion of printing PS - Yes, I should have raised exception. |
This MR makes following modifications to facilitate printing error messages when job submission fails.
1. Adds try-except block when submitting jobs to print error messages directly in the terminal.2. Prints stdout from job submission (
res) as typical string instead of binary string.