Skip to content

Commit 03f4297

Browse files
committed
Update error message
1 parent 2c642fb commit 03f4297

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/fosslight_source/run_scancode.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,17 @@ def run_scan(path_to_scan, output_file_name="",
104104
if results:
105105
sheet_list = {}
106106
has_error = False
107-
if len(results.keys()) > 0 and not success:
108-
success = True
109-
msg = "[Minor_error]"
110107
if "headers" in results:
111108
has_error, error_msg = get_error_from_header(results["headers"])
112109
if has_error:
113110
_result_log["Error_files"] = error_msg
114-
msg += "Failed to analyze :"+ error_msg
111+
msg = "Failed to analyze :"+ error_msg
115112
if "files" in results:
116113
rc, result_list, parsing_msg = parsing_file_item(results["files"], has_error)
117114
_result_log["Parsing Log"] = parsing_msg
118115
if rc:
116+
if not success:
117+
success = True
119118
result_list = sorted(
120119
result_list, key=lambda row: (''.join(row.licenses)))
121120
sheet_list["SRC"] = [scan_item.get_row_to_print() for scan_item in result_list]

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ commands =
1616
fosslight_convert -h
1717
fosslight_source -p tests/test_files -j -o test_scan/scan_result
1818
cat test_scan/scan_result.csv
19-
fosslight_convert -p tests/json_result/scan_has_error.json -o test_convert/convert_result
20-
fosslight_convert -p test_scan/scan_result.json -o test_convert/convert_result2
19+
fosslight_convert -p tests/json_result/scan_has_error.json -o test_convert/convert_result2
20+
fosslight_convert -p test_scan/scan_result.json -o test_convert/convert_result
2121
cat test_convert/convert_result.csv
2222
python tests/cli_test.py

0 commit comments

Comments
 (0)