logging and rethrowing exception