diff --git a/sdk/program/src/feature.rs b/sdk/program/src/feature.rs index 25a3ec8a45b73e..b46704ebcb9992 100644 --- a/sdk/program/src/feature.rs +++ b/sdk/program/src/feature.rs @@ -30,9 +30,10 @@ impl Feature { pub fn from_account_info(account_info: &AccountInfo) -> Result { if *account_info.owner != id() { - return Err(ProgramError::InvalidArgument); + return Err(ProgramError::InvalidAccountOwner); } - bincode::deserialize(&account_info.data.borrow()).map_err(|_| ProgramError::InvalidArgument) + bincode::deserialize(&account_info.data.borrow()) + .map_err(|_| ProgramError::InvalidAccountData) } }