obfuscator should handle exceptions raised by get_file_type; at the moment any exceptions raised will be caught in the final except block which logs critical unexpected errors, illustrated below:
except Exception as e:
logger.critical("An unexpected error occurred", exc_info=True)
raise e
Proposed resolution
Add new except block to handle exceptions raised by get_file_type before the other except blocks, to ensure that error handling follows the flow of the function.
Issue
obfuscator
should handle exceptions raised byget_file_type
; at the moment any exceptions raised will be caught in the finalexcept
block which logs critical unexpected errors, illustrated below:Proposed resolution
Add new
except
block to handle exceptions raised byget_file_type
before the otherexcept
blocks, to ensure that error handling follows the flow of the function.