Raising and catching exceptions in the same block may lead to confusion, try to abstract the raise to an inner function.
try:
a = process()
if not a:
raise CustomException(a)
except Exception:
logger.exception("something failed")
try:
a = process() # This throws the exception now
except CustomException:
logger.exception("a failed")
except Exception:
logger.exception("something failed")