mirror of
https://github.com/MillironX/nfdocs-parser.git
synced 2024-11-21 08:46:03 +00:00
Add error catching for YAML parsing
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
This commit is contained in:
parent
48c2d7a151
commit
54dc67b0d3
1 changed files with 6 additions and 2 deletions
|
@ -161,7 +161,11 @@ class NFDocs(Directive):
|
|||
doc_yaml = ""
|
||||
for i in pos:
|
||||
doc_yaml = doc_yaml + nextflow_lines[i].replace(self.DOC_STARTER, "")
|
||||
docstrings[proc_type][proc_name] = yaml.safe_load(doc_yaml)
|
||||
try:
|
||||
docstrings[proc_type][proc_name] = yaml.safe_load(doc_yaml)
|
||||
except:
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.warning(f"Could not parse YAML for {proc_name}")
|
||||
|
||||
# Try to convert each definition to a node
|
||||
for block_type, block_docs in docstrings.items():
|
||||
|
@ -206,5 +210,5 @@ class NFDocs(Directive):
|
|||
def setup(app):
|
||||
app.add_directive('nfdocs', NFDocs)
|
||||
return {
|
||||
"version": "0.1.1"
|
||||
"version": "0.1.2"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue