{"record":{"id":"067186d7b528fc5e","repo":"risingwavelabs/risingwave","slug":"invalid-parameter-name-reason","errorCode":null,"errorMessage":"Invalid parameter {name}: {reason}","messagePattern":"Invalid parameter (.+?): (.+?)","errorType":"exception","errorClass":"ExprError","httpStatus":null,"severity":"error","filePath":"src/expr/core/src/error.rs","lineNumber":74,"sourceCode":"    CastOutOfRange(&'static str),\n\n    #[error(\"Numeric out of range\")]\n    NumericOutOfRange,\n\n    #[error(\"Numeric out of range: underflow\")]\n    NumericUnderflow,\n\n    #[error(\"Numeric out of range: overflow\")]\n    NumericOverflow,\n\n    #[error(\"Division by zero\")]\n    DivisionByZero,\n\n    #[error(\"Parse error: {0}\")]\n    // TODO(error-handling): should prefer use error types than strings.\n    Parse(Box<str>),\n\n    #[error(\"Invalid parameter {name}: {reason}\")]\n    // TODO(error-handling): should prefer use error types than strings.\n    InvalidParam {\n        name: &'static str,\n        reason: Box<str>,\n    },\n\n    #[error(\"Array error: {0}\")]\n    Array(\n        #[from]\n        #[backtrace]\n        ArrayError,\n    ),\n\n    #[error(\"More than one row returned by {0} used as an expression\")]\n    MaxOneRow(&'static str),\n\n    /// TODO: deprecate in favor of `Function`\n    #[error(transparent)]","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/expr/core/src/error.rs#L56-L92","documentation":"ExprError::InvalidParam { name, reason } signals that a named parameter passed to an expression or function is invalid, with `name` identifying the offending parameter and `reason` explaining why. It exists so function implementations can reject bad inputs with a precise message rather than an opaque string error. Like Parse, the TODO notes it should eventually use structured error types.","triggerScenarios":"Calling an expression function with an out-of-range, malformed, or semantically invalid argument that the function validates by name (e.g. an invalid timezone name, an invalid format string, a negative argument where positive is required).","commonSituations":"Typos in function arguments, unsupported timezone/format specifiers, invalid options passed to string/date functions, copy-pasted arguments that don't fit the new call site.","solutions":["Read the `name`/`reason` in the message and correct that specific argument.","Check the function's documentation for the accepted domain of the parameter.","Validate user-supplied parameter values in application code or SQL before invoking the function."],"exampleFix":"// before\nSELECT date_trunc('centuryish', ts) FROM t;\n// after\nSELECT date_trunc('century', ts) FROM t;","handlingStrategy":"validation","validationCode":"-- validate parameter domain before call\nSELECT CASE WHEN tz IN ('UTC','America/New_York', ...) THEN date_trunc('day', ts, tz) ELSE NULL END FROM t;","typeGuard":null,"tryCatchPattern":"// Extract name/reason for a precise user message\nlet err = result.err() else { return Ok(()) };\nlet msg = err.to_string(); // \"Invalid parameter <name>: <reason>\"\nreject(msg);","preventionTips":["Whitelist accepted parameter values (timezones, format specifiers) at the call site.","Copy function signatures carefully when adapting example calls.","Validate dynamic parameters in application code before issuing SQL."],"tags":["rust","validation","parameters"],"backgroundTag":"invalid-argument-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}