From e75f0bdfd35ad6320050b047932e3a5927f6e351 Mon Sep 17 00:00:00 2001 From: Jack May Date: Thu, 23 Jul 2020 12:11:01 -0700 Subject: [PATCH] panic on native load failure (#11182) --- runtime/src/native_loader.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime/src/native_loader.rs b/runtime/src/native_loader.rs index dc1901a9a4..3b032ad7bb 100644 --- a/runtime/src/native_loader.rs +++ b/runtime/src/native_loader.rs @@ -108,14 +108,12 @@ impl NativeLoader { Ok(entrypoint) } Err(e) => { - warn!("Unable to find program entrypoint in {:?}: {:?})", name, e); - Err(NativeLoaderError::EntrypointNotFound.into()) + panic!("Unable to find program entrypoint in {:?}: {:?})", name, e); } } } Err(e) => { - warn!("Failed to load: {:?}", e); - Err(NativeLoaderError::FailedToLoad.into()) + panic!("Failed to load: {:?}", e); } } } @@ -135,8 +133,7 @@ impl NativeLoader { let name = match str::from_utf8(name_vec) { Ok(v) => v, Err(e) => { - warn!("Invalid UTF-8 sequence: {}", e); - return Err(NativeLoaderError::InvalidEntrypointName.into()); + panic!("Invalid UTF-8 sequence: {}", e); } }; trace!("Call native {:?}", name);