Skip to content

Commit 6ebdb83

Browse files
committed
fix: [stix export] Putting the conversion result traceback out of the try/except loop
1 parent 16608a4 commit 6ebdb83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

misp_stix_converter/misp_stix_converter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,9 @@ def misp_to_stix1(
609609
_write_raw_stix(
610610
parser.stix_package, name, namespace, org, return_format
611611
)
612-
return _generate_traceback(debug, parser, name)
613612
except Exception as exception:
614613
return {'fails': [f'{filename} - {exception.__str__()}']}
614+
return _generate_traceback(debug, parser, name)
615615

616616

617617
def misp_to_stix2(filename: _files_type, debug: Optional[bool] = False,
@@ -630,9 +630,9 @@ def misp_to_stix2(filename: _files_type, debug: Optional[bool] = False,
630630
)
631631
with open(name, 'wt', encoding='utf-8') as f:
632632
f.write(json.dumps(parser.bundle, cls=STIXJSONEncoder, indent=4))
633-
return _generate_traceback(debug, parser, name)
634633
except Exception as exception:
635634
return {'fails': [f'{filename} - {exception.__str__()}']}
635+
return _generate_traceback(debug, parser, name)
636636

637637

638638
################################################################################

0 commit comments

Comments
 (0)