Your solution looks ok to me. Alternatively (not necessarily "better"), here is a DRY version without using `isinstance`: lasterr=None try: some_func() except FirstException as err: # known possible err # log err lasterr=err except SecondException as err: # known possible err # log err lasterr=err except Exception as err: # unexpected err to prevent crash # log err lasterr=err finally: if lasterr is not None: notify_user(err) # close logs Of course, the statement `lasterr=err` is repeated here, but since this does not contain any real "logic", this usually does not count as a DRY violation.