fix invalid error handling
fix invalid error handling

jsenellart/OpenNMT,jungikim/OpenNMT,jsenellart/OpenNMT,OpenNMT/OpenNMT,jsenellart-systran/OpenNMT,jungikim/OpenNMT,jsenellart-systran/OpenNMT,jsenellart-systran/OpenNMT,OpenNMT/OpenNMT,jsenellart/OpenNMT,OpenNMT/OpenNMT,jungikim/OpenNMT