Commit e96b6f8c by dorp

fixed problem with error code handling

parent ba94a0ba
...@@ -40,8 +40,11 @@ def main(template_style='default'): ...@@ -40,8 +40,11 @@ def main(template_style='default'):
with TemporaryDirectory() as tmp_dir: with TemporaryDirectory() as tmp_dir:
create_templates(analysis, meta_data, tmp_dir, template_style) create_templates(analysis, meta_data, tmp_dir, template_style)
try:
target_path = compile_pdf(meta_data, tmp_dir) target_path = compile_pdf(meta_data, tmp_dir)
move_pdf_report(target_path) move_pdf_report(target_path)
except RuntimeError:
pass
return 0 return 0
......
import os import os
import shutil import shutil
import sys
from pathlib import Path from pathlib import Path
from common_helper_process import execute_shell_command_get_return_code from common_helper_process import execute_shell_command_get_return_code
...@@ -17,8 +16,9 @@ def execute_latex(tmp_dir): ...@@ -17,8 +16,9 @@ def execute_latex(tmp_dir):
os.chdir(tmp_dir) os.chdir(tmp_dir)
output, return_code = execute_shell_command_get_return_code('env buf_size=1000000 pdflatex {}'.format(MAIN_TEMPLATE)) output, return_code = execute_shell_command_get_return_code('env buf_size=1000000 pdflatex {}'.format(MAIN_TEMPLATE))
if return_code != 0: if return_code != 0:
print(f'Error when trying to build PDF:\n{output}') print(f'Warnings / Errors when trying to build PDF:\n{output}')
sys.exit(1) if not Path('main.pdf').exists():
raise RuntimeError('No pdf output generated. Aborting.')
os.chdir(current_dir) os.chdir(current_dir)
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
\BLOCK{endfor} \BLOCK{endfor}
\BLOCK{endif} \BLOCK{endif}
\BLOCK{else} \BLOCK{else}
No Crypto Analysis not present
\BLOCK{endif} \BLOCK{endif}
} }
%---------------------------------------------------------------------------------------- %----------------------------------------------------------------------------------------
...@@ -53,7 +53,7 @@ No Crypto ...@@ -53,7 +53,7 @@ No Crypto
\skills{\VAR{ analysis | call_for_mitigations}} \skills{\VAR{ analysis | call_for_mitigations}}
\BLOCK{endif} \BLOCK{endif}
\BLOCK{else} \BLOCK{else}
\skills{No Analysis Done/1} \skills{Analysis not present/1}
\BLOCK{endif} \BLOCK{endif}
\makeprofile \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