{"record":{"id":"cd2f5923a060d273","repo":"risingwavelabs/risingwave","slug":"0-cd2f59","errorCode":null,"errorMessage":"{0}","messagePattern":"\\{0\\}","errorType":"exception","errorClass":"ExprError","httpStatus":null,"severity":"error","filePath":"src/expr/core/src/error.rs","lineNumber":124,"sourceCode":"    FieldNameNull,\n\n    #[error(\"too few arguments for format()\")]\n    TooFewArguments,\n\n    #[error(\n        \"null value in column \\\"{col_name}\\\" of relation \\\"{table_name}\\\" violates not-null constraint\"\n    )]\n    NotNullViolation {\n        col_name: Box<str>,\n        table_name: Box<str>,\n    },\n\n    #[error(\"invalid state: {0}\")]\n    InvalidState(String),\n\n    /// Function error message returned by UDF.\n    /// TODO: replace with `Function`\n    #[error(\"{0}\")]\n    Custom(String),\n\n    /// Error from a function call.\n    ///\n    /// Use [`ExprError::function`] to create this error.\n    #[error(\"error while evaluating expression `{display}`\")]\n    Function {\n        display: Box<str>,\n        #[backtrace]\n        // We don't use `anyhow::Error` because we don't want to always capture the backtrace.\n        source: Box<dyn std::error::Error + Send + Sync>,\n    },\n}\n\nstatic_assertions::const_assert_eq!(std::mem::size_of::<ExprError>(), 40);\n\nimpl ExprError {\n    /// Constructs a [`ExprError::Function`] error with the given information for display.","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/expr/core/src/error.rs#L106-L142","documentation":"ExprError::Custom is a pass-through variant that surfaces an arbitrary error message verbatim, primarily used to propagate UDF (user-defined function) errors into the expression error type. The message content comes entirely from the caller, most often external UDF code. Nothing is added by the framework, so diagnosis depends on the UDF author's message.","triggerScenarios":"A UDF returns an error (e.g. via a failed external function call), and the UDF runtime wraps that error message into ExprError::Custom.","commonSituations":"Python/JavaScript/SQL UDFs raising exceptions or returning error strings; remote UDF services returning failure payloads; misconfigured UDF external servers.","solutions":["Read the raw message — it originates from the UDF itself","Fix the input data or arguments that caused the UDF to fail","Check the UDF implementation/service logs for the underlying cause","If the UDF is external, verify the UDF service is running and reachable"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Validate UDF inputs before calling\nif !udf_inputs_valid(args) { return Err(\"invalid UDF args\"); }","typeGuard":null,"tryCatchPattern":"match result { Err(ExprError::Custom(msg)) => { log::error!(\"UDF failed: {msg}\"); fallback_or_abort(msg) }, Ok(v) => v, Err(e) => return Err(e) }","preventionTips":["Test UDFs against edge-case and null inputs before deploying","Monitor UDF service health if using external UDFs","Wrap UDF logic with its own input validation"],"tags":["rust","udf","error-propagation"],"backgroundTag":"upstream-api-error","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"}