Only raise when appropriate to prevent undesired termination.