Skip to content

Commit

Permalink
fix(cron): improve error message for invalid cron names (#24644)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
irbull authored Jul 18, 2024
1 parent d80d0ce commit 1722e0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/cron/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

0 comments on commit 1722e0a

Please sign in to comment.