// Generic and unclear error messages
return Err(ProgramError::InvalidInstructionData);
// Clear and descriptive custom error codes
#[error_code]
pub enum CustomError {
#[msg("Invalid configuration.")]
InvalidConfig,
}
return Err(CustomError::InvalidConfig.into());