{"record":{"id":"01820c30eca5babb","repo":"bevyengine/bevy","slug":"system-returned-error-0","errorCode":null,"errorMessage":"System returned error: {0}","messagePattern":"System returned error: (.+?)","errorType":"exception","errorClass":"RegisteredSystemError","httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/system/system_registry.rs","lineNumber":863,"sourceCode":"    #[error(\"System {0:?} was not registered\")]\n    SystemIdNotRegistered(SystemId<I, O>),\n    /// A cached system was removed by value, but no system with its type was found.\n    ///\n    /// Did you forget to register it?\n    #[error(\"Cached system was not found\")]\n    SystemNotCached,\n    /// The `RegisteredSystem` component is missing.\n    #[error(\"System {0:?} does not have a RegisteredSystem component. This only happens if app code removed the component.\")]\n    MissingRegisteredSystemComponent(SystemId<I, O>),\n    /// A system tried to remove itself.\n    #[error(\"System {0:?} tried to remove itself\")]\n    SelfRemove(SystemId<I, O>),\n    /// System could not be run due to parameters that failed validation.\n    /// This is not considered an error.\n    #[error(\"System did not run due to failed parameter validation: {0}\")]\n    Skipped(SystemParamValidationError),\n    /// System returned an error or failed required parameter validation.\n    #[error(\"System returned error: {0}\")]\n    Failed(BevyError),\n    /// [`SystemId`] had different input and/or output types than [`SystemIdMarker`]\n    #[error(\"Could not get system from `{}`, entity was `SystemId<{}, {}>`\", DebugName::type_name::<SystemId<I, O>>(), .1.input_type_id.name, .1.output_type_id.name)]\n    IncorrectType(SystemId<I, O>, SystemIdMarker),\n    /// System is not present in the `RegisteredSystem` component.\n    // TODO: We should consider using catch_unwind to protect against the panic case.\n    #[error(\"The system is not present in the RegisteredSystem component. This can happen if the system was called recursively or if the system panicked on the last run.\")]\n    SystemMissing(SystemId<I, O>),\n}\n\nimpl<I: SystemInput, O> From<RunSystemError> for RegisteredSystemError<I, O> {\n    fn from(value: RunSystemError) -> Self {\n        match value {\n            RunSystemError::Skipped(err) => Self::Skipped(err),\n            RunSystemError::Failed(err) => Self::Failed(err),\n        }\n    }\n}","sourceCodeStart":845,"sourceCodeEnd":881,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/system/system_registry.rs#L845-L881","documentation":"RegisteredSystemError::SystemError: the stored system ran but returned an error from its In/Out pipe (e.g. an Infallible/Result-returning system propagated a failure), wrapping the original error.","triggerScenarios":"Thrown at crates/bevy_ecs/src/system/system_registry.rs:863 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error to find the underlying cause","Handle the failure at the call site of run_system_with instead of letting the system return Err","Make the system itself handle or log the error before returning"],"exampleFix":null,"handlingStrategy":"try-catch","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"}