Commit e96b6f8c by dorp

fixed problem with error code handling

parent ba94a0ba
......@@ -40,8 +40,11 @@ def main(template_style='default'):
with TemporaryDirectory() as tmp_dir:
create_templates(analysis, meta_data, tmp_dir, template_style)
target_path = compile_pdf(meta_data, tmp_dir)
move_pdf_report(target_path)
try:
target_path = compile_pdf(meta_data, tmp_dir)
move_pdf_report(target_path)
except RuntimeError:
pass
return 0
......
import os
import shutil
import sys
from pathlib import Path
from common_helper_process import execute_shell_command_get_return_code
......@@ -17,8 +16,9 @@ def execute_latex(tmp_dir):
os.chdir(tmp_dir)
output, return_code = execute_shell_command_get_return_code('env buf_size=1000000 pdflatex {}'.format(MAIN_TEMPLATE))
if return_code != 0:
print(f'Error when trying to build PDF:\n{output}')
sys.exit(1)
print(f'Warnings / Errors when trying to build PDF:\n{output}')
if not Path('main.pdf').exists():
raise RuntimeError('No pdf output generated. Aborting.')
os.chdir(current_dir)
......
......@@ -41,7 +41,7 @@
\BLOCK{endfor}
\BLOCK{endif}
\BLOCK{else}
No Crypto
Analysis not present
\BLOCK{endif}
}
%----------------------------------------------------------------------------------------
......@@ -53,7 +53,7 @@ No Crypto
\skills{\VAR{ analysis | call_for_mitigations}}
\BLOCK{endif}
\BLOCK{else}
\skills{No Analysis Done/1}
\skills{Analysis not present/1}
\BLOCK{endif}
\makeprofile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment