Close VDM before throwing an exception.