{"record":{"id":"aa83f8484df70da9","repo":"tokio-rs/tokio","slug":"no-such-unhandled-panic-behavior-s-the-unhand","errorCode":null,"errorMessage":"No such unhandled panic behavior `{s}`. The unhandled panic behaviors are `ignore` and `shutdown_runtime`.","messagePattern":"No such unhandled panic behavior `(.+?)`\\. The unhandled panic behaviors are `ignore` and `shutdown_runtime`\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"tokio-macros/src/entry.rs","lineNumber":41,"sourceCode":"            \"basic_scheduler\" => Err(\"The `basic_scheduler` runtime flavor has been renamed to `current_thread`.\".to_string()),\n            \"threaded_scheduler\" => Err(\"The `threaded_scheduler` runtime flavor has been renamed to `multi_thread`.\".to_string()),\n            _ => Err(format!(\"No such runtime flavor `{s}`. The runtime flavors are `current_thread`, `local`, and `multi_thread`.\")),\n        }\n    }\n}\n\n#[derive(Clone, Copy, PartialEq)]\nenum UnhandledPanic {\n    Ignore,\n    ShutdownRuntime,\n}\n\nimpl UnhandledPanic {\n    fn from_str(s: &str) -> Result<UnhandledPanic, String> {\n        match s {\n            \"ignore\" => Ok(UnhandledPanic::Ignore),\n            \"shutdown_runtime\" => Ok(UnhandledPanic::ShutdownRuntime),\n            _ => Err(format!(\"No such unhandled panic behavior `{s}`. The unhandled panic behaviors are `ignore` and `shutdown_runtime`.\")),\n        }\n    }\n\n    fn into_tokens(self, crate_path: &TokenStream) -> TokenStream {\n        match self {\n            UnhandledPanic::Ignore => quote! { #crate_path::runtime::UnhandledPanic::Ignore },\n            UnhandledPanic::ShutdownRuntime => {\n                quote! { #crate_path::runtime::UnhandledPanic::ShutdownRuntime }\n            }\n        }\n    }\n}\n\nstruct FinalConfig {\n    name: Option<String>,\n    flavor: RuntimeFlavor,\n    worker_threads: Option<usize>,\n    start_paused: Option<bool>,","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/tokio-rs/tokio/blob/625954f365727668cb02d04172b34f1149637728/tokio-macros/src/entry.rs#L23-L59","documentation":"`UnhandledPanic::from_str` (entry.rs:46) only accepts `ignore` and `shutdown_runtime`. Any other value (including typos or wrong case) falls through to this formatted error, listing the two valid behaviors.","triggerScenarios":"Writing `#[tokio::main(unhandled_panic = \"kill\")]`, `unhandled_panic = \"ShutdownRuntime\"`, or any unrecognized behavior name.","commonSituations":"Guessing the behavior name; mixing in terms from other runtimes; case sensitivity.","solutions":["Use exactly `ignore` or `shutdown_runtime` (lowercase, with the underscore).","If unsure which you need, `ignore` leaves the runtime running; `shutdown_runtime` tears it down on the first task panic."],"exampleFix":"// before\n#[tokio::main(flavor = \"current_thread\", unhandled_panic = \"shutdown\")]\nasync fn main() {}\n\n// after\n#[tokio::main(flavor = \"current_thread\", unhandled_panic = \"shutdown_runtime\")]\nasync fn main() {}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exactly `ignore` or `shutdown_runtime` (lowercase).","Remember this option only applies to the `current_thread` flavor.","Double-check spelling/case when copying from docs."],"tags":["tokio","macros","compile-error","config","invalid-value"],"backgroundTag":null,"analyzedSha":"625954f365727668cb02d04172b34f1149637728","analyzedAt":"2026-08-11T17:46:45.378Z","contentChangedAt":"2026-08-11T17:46:45.378Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}