Skip to content

Commit 5e6b631

Browse files
committed
snafu instead of unwrap
1 parent 5f65a98 commit 5e6b631

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rust/operator-binary/src/druid_controller.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,10 @@ fn build_rolegroup_config_map(
689689
druid_tls_security: &DruidTlsSecurity,
690690
druid_auth_config: &Option<DruidAuthenticationConfig>,
691691
) -> Result<ConfigMap> {
692-
let druid_role = DruidRole::from_str(&rolegroup.role).unwrap();
692+
let druid_role =
693+
DruidRole::from_str(&rolegroup.role).with_context(|_| UnidentifiedDruidRoleSnafu {
694+
role: &rolegroup.role,
695+
})?;
693696
let role = druid.get_role(&druid_role);
694697
let mut cm_conf_data = BTreeMap::new(); // filename -> filecontent
695698

0 commit comments

Comments
 (0)