Package: effect
Module: Cron
Represents an error that occurs when parsing a cron expression fails.
When to use
Use to handle invalid cron expression failures returned by parse.
Details
This error provides information about what went wrong during parsing, including the error message and optionally the input that caused the error.
Example (Handling cron parse failures)
import { Cron, Result } from "effect"
const result = Cron.parse("invalid expression")
if (Result.isFailure(result)) {
const error: Cron.CronParseError = result.failure
console.log(error.message) // "Invalid number of segments in cron expression"
console.log(error.input) // "invalid expression"
}
See
parse for the parser that returns this error in Result.failisCronParseError for narrowing unknown values to this error typeSignature
declare class CronParseError
Since v4.0.0