mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
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.
This commit is contained in:
parent
d80d0cea7c
commit
1722e0aebf
1 changed files with 1 additions and 1 deletions
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue