Update HashIdentifier.py

added support for exception handling.