Skip to content

Commit 09a9d73

Browse files
authored
Merge pull request #74 from fosslight/develop
Add execution error handling for html
2 parents 0c4f4aa + 9e0b3a6 commit 09a9d73

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/fosslight_reuse/_result_html.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,15 @@ def result_for_html(result_item, project: Project, path_to_find):
8484
cell_contents_str = get_html_cell(result_item, project, path_to_find)
8585
html_in_str = f"{HTML_FORMAT_PREFIX}{compliance_str}{summary_str}{HTML_CELL_PREFIX}{cell_contents_str}{HTML_FORMAT_SUFFIX}"
8686
else:
87-
cell_contents_str = "<b> &#9888; There are so many incompliant files, so result can't be printed in html. </b>"
88-
html_in_str = f"{HTML_FORMAT_PREFIX}{compliance_str}{summary_str}{cell_contents_str}{HTML_FORMAT_SUFFIX}"
87+
err_str = "There are so many incompliant files, so result can't be printed in html."
88+
result_item.execution_error.append(err_str)
89+
90+
if result_item.execution_error:
91+
err_str = ""
92+
execution_err_str = "<b> &#9888; Execution Error </b>"
93+
for error in result_item.execution_error:
94+
err_str = f"<br>&nbsp;&nbsp;&nbsp; - {error}"
95+
execution_err_str += err_str
96+
html_in_str = f"{HTML_FORMAT_PREFIX}{compliance_str}{summary_str}{execution_err_str}{HTML_FORMAT_SUFFIX}"
8997

90-
# if result_item.execution_error:
91-
# TODO: How do handle for execution_error in html format?
9298
return html_in_str

0 commit comments

Comments
 (0)