Skip to content

Commit

Permalink
Merge pull request #25477 from joshuahansel/media-plot-command-fix
Browse files Browse the repository at this point in the history
Added error message for failed plot script in MooseDocs
  • Loading branch information
joshuahansel authored Sep 16, 2023
2 parents f6139c9 + b97e072 commit 49df46a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/MooseDocs/extensions/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ def createToken(self, parent, info, page, settings):

# Generate the plot
LOG.info("Executing plot script %s", script_path)
result = subprocess.run(["python", script_path], capture_output=True)
result = subprocess.run(["python", script_path], capture_output=True, text=True)
if result.returncode != 0:
msg = "Failed to execute python script: %s"
raise exceptions.MooseDocsException(msg, script_path)
msg = "Failed to execute python script '{}':\n{}"
raise exceptions.MooseDocsException(msg, script_path, result.stderr)

# Currently the plot is assumed to reside in the same directory as the plot script.
plot_name = settings['image_name'] or os.path.basename(script_path).replace('.py', '.png')
Expand Down

0 comments on commit 49df46a

Please sign in to comment.