From 1722e0aebfd830b7cbc0824ace5de0517072d0dc Mon Sep 17 00:00:00 2001 From: Ian Bull Date: Thu, 18 Jul 2024 13:52:17 -0700 Subject: [PATCH] fix(cron): improve error message for invalid cron names (#24644) When a cron name is invalid, it wasn't necessarily clear why. This change-set improves the error message to inform the user of the valid characters in a cron name. --- ext/cron/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/cron/lib.rs b/ext/cron/lib.rs index a0f1c44e1e..ede01ba45f 100644 --- a/ext/cron/lib.rs +++ b/ext/cron/lib.rs @@ -121,7 +121,7 @@ fn validate_cron_name(name: &str) -> Result<(), AnyError> { if !name.chars().all(|c| { c.is_ascii_whitespace() || c.is_ascii_alphanumeric() || c == '_' || c == '-' }) { - return Err(type_error("Invalid cron name")); + return Err(type_error("Invalid cron name. Only alphanumeric characters, whitespace, hyphens, and underscores are allowed")); } Ok(()) }