CJohnston079 / obfuscator

0 stars 0 forks source link

`obfuscator` should handle exceptions raised by `get_file_type` #13

Closed CJohnston079 closed 4 months ago

CJohnston079 commented 4 months ago

Issue

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.

CJohnston079 commented 4 months ago

Resolved in bf12128a695dc99d347f34828589877e64634944 with proposed resolution.