{"record":{"id":"92d6a7feb0c04fc7","repo":"bevyengine/bevy","slug":"received-received-arguments-but-expected-one-of","errorCode":null,"errorMessage":"received {received} arguments but expected one of {expected:?}","messagePattern":"received (.+?) arguments but expected one of (.+?)","errorType":"exception","errorClass":"FunctionError","httpStatus":null,"severity":"error","filePath":"crates/bevy_reflect/src/func/error.rs","lineNumber":20,"sourceCode":"use crate::func::{\n    args::{ArgCount, ArgError},\n    Return,\n};\nuse alloc::borrow::Cow;\nuse bevy_platform::collections::HashSet;\nuse thiserror::Error;\n\n/// An error that occurs when calling a [`DynamicFunction`] or [`DynamicFunctionMut`].\n///\n/// [`DynamicFunction`]: crate::func::DynamicFunction\n/// [`DynamicFunctionMut`]: crate::func::DynamicFunctionMut\n#[derive(Debug, Error, PartialEq)]\npub enum FunctionError {\n    /// An error occurred while converting an argument.\n    #[error(transparent)]\n    ArgError(#[from] ArgError),\n    /// The number of arguments provided does not match the expected number.\n    #[error(\"received {received} arguments but expected one of {expected:?}\")]\n    ArgCountMismatch {\n        /// Expected argument count. [`ArgCount`] for overloaded functions will contain multiple possible counts.\n        expected: ArgCount,\n        /// Number of arguments received.\n        received: usize,\n    },\n    /// No overload was found for the given set of arguments.\n    #[error(\"no overload found for arguments with signature `{received:?}`, expected one of `{expected:?}`\")]\n    NoOverload {\n        /// The set of available argument signatures.\n        expected: HashSet<ArgumentSignature>,\n        /// The received argument signature.\n        received: ArgumentSignature,\n    },\n}\n\n/// The result of calling a [`DynamicFunction`] or [`DynamicFunctionMut`].\n///","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_reflect/src/func/error.rs#L2-L38","documentation":"FunctionError::ArgCountMismatch — a dynamic function/mut function was called with a number of arguments matching none of its registered overload signatures. Payloads: the received count and the set of expected counts.","triggerScenarios":"Thrown at crates/bevy_reflect/src/func/error.rs:20 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass exactly the arguments the function expects","Inspect the function's signature info before calling"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}