Skip to content

Commit 0ee8d2b

Browse files
committed
Log Crowbar output if decompiling a model produces an invalid QC
1 parent 548a072 commit 0ee8d2b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hammeraddons/propcombine.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,10 @@ async def decompile_model(
809809
]
810810
LOGGER.debug('Executing {}', ' '.join(args))
811811
result = await trio.run_process(args, capture_stdout=True, check=False)
812+
result_out = result.stdout.replace(b'\r\n', b'\n').decode('ascii', 'backslashescape')
812813
if result.returncode != 0:
813814
LOGGER.warning('Could not decompile "{}"!', filename)
814-
LOGGER.debug('{}', result.stdout.replace(b'\r\n', b'\n').decode('ascii', 'replace'))
815+
LOGGER.debug('{}', result_out)
815816
return None
816817
# There should now be a QC file here.
817818
failed = False
@@ -827,8 +828,11 @@ async def decompile_model(
827828
else: # not found or couldn't be parsed.
828829
if not failed: # Don't produce both errors.
829830
LOGGER.warning('No QC outputted into {}', cache_folder)
831+
failed = True
830832
qc_result = None
831833
qc_path = Path()
834+
if failed:
835+
LOGGER.debug('Crowbar output for {}:\n{}', filename, result_out)
832836

833837
cache_kv = Keyvalues('qc', [])
834838
cache_kv['checksum'] = checksum.hex()

0 commit comments

Comments
 (0)