{"record":{"id":"55d89b52deb43446","repo":"dbt-labs/dbt-core","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":"crates/dbt-runtime-macros/src/entry.rs","lineNumber":191,"sourceCode":"        self.crate_name = Some(name_path);\n        Ok(())\n    }\n\n    fn set_unhandled_panic(\n        &mut self,\n        unhandled_panic: syn::Lit,\n        span: Span,\n    ) -> Result<(), syn::Error> {\n        if self.unhandled_panic.is_some() {\n            return Err(syn::Error::new(\n                span,\n                \"`unhandled_panic` set multiple times.\",\n            ));\n        }\n\n        let unhandled_panic = parse_string(unhandled_panic, span, \"unhandled_panic\")?;\n        let unhandled_panic =\n            UnhandledPanic::from_str(&unhandled_panic).map_err(|err| syn::Error::new(span, err))?;\n        self.unhandled_panic = Some((unhandled_panic, span));\n        Ok(())\n    }\n\n    fn macro_name(&self) -> &'static str {\n        if self.is_test {\n            \"dbt_runtime::test\"\n        } else {\n            \"dbt_runtime::main\"\n        }\n    }\n\n    fn build(&self) -> Result<FinalConfig, syn::Error> {\n        use RuntimeFlavor as F;\n\n        let flavor = self.flavor.unwrap_or(self.default_flavor);\n\n        let worker_threads = match (flavor, self.worker_threads) {","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-runtime-macros/src/entry.rs#L173-L209","documentation":"After parsing `unhandled_panic` as a string, the macro converts it to an UnhandledPanic enum via from_str; only `ignore` and `shutdown_runtime` are accepted. Any other string produces this compile error at the attribute value's span. This mirrors tokio::runtime::UnhandledPanic's FromStr.","triggerScenarios":"#[tokio::test(unhandled_panic = \"abort\")] or any misspelling like `shutdown-runtime`, `ShutdownRuntime`, `panic` — anything UnhandledPanic::from_str rejects.","commonSituations":"Guessing valid behavior names; using kebab-case instead of snake_case; assuming tokio Builder's enum variant names translate directly to attribute strings.","solutions":["Use exactly `ignore` or `shutdown_runtime` as the value","Fix case: values are lowercase snake_case","Remove the option to use the default behavior"],"exampleFix":"// before\n#[tokio::test(unhandled_panic = \"abort\")]\nasync fn t() {}\n\n// after\n#[tokio::test(unhandled_panic = \"shutdown_runtime\")]\nasync fn t() {}","handlingStrategy":"validation","validationCode":"fn check_unhandled_panic(v: &str) -> Result<(), String> {\n    match v {\n        \"ignore\" | \"shutdown_runtime\" => Ok(()),\n        other => Err(format!(\"invalid unhandled_panic `{other}`; use `ignore` or `shutdown_runtime`\")),\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Memorize the two valid values: ignore, shutdown_runtime (snake_case, lowercase)","Check tokio's UnhandledPanic docs for the accepted strings","Don't translate Rust enum variant casing into the attribute string"],"tags":["rust","proc-macro","tokio","compile-time"],"backgroundTag":"invalid-enum-value","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}