Skip to content


Browse files Browse the repository at this point in the history
feat: Add more informative errors when evaluation of `--default-resou…
…rces` fails (#1192)

* Add more informative errors when evalution of `--default-resources` fails

* Raise a `WorkflowError` if evaluation of `--default-resources` fails

* Trivial - re-run tests

Co-authored-by: Johannes Köster <>
  • Loading branch information
DonFreed and johanneskoester committed Oct 11, 2021
1 parent 0503a73 commit b3c4e68
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions snakemake/
@@ -1,6 +1,8 @@
import re
import tempfile

from snakemake.exceptions import WorkflowError

class DefaultResources:
defaults = {
Expand Down Expand Up @@ -58,6 +60,19 @@ def callable(wildcards, input, attempt, threads, rulename):
# Triggers for string arguments like n1-standard-4
except NameError:
return val
except Exception as e:
if not (
isinstance(e, FileNotFoundError) and e.filename in input
# Missing input files are handled by the caller
raise WorkflowError(
"Failed to evaluate DefaultResources value "
" String arguments may need additional "
"quoting. Ex: --default-resources "
raise e
return value

return callable
Expand Down

0 comments on commit b3c4e68

Please sign in to comment.