{"record":{"id":"f667987eb5c2d0b1","repo":"linebender/druid","slug":"unhandled-dialog-result","errorCode":null,"errorMessage":"Unhandled dialog result","messagePattern":"Unhandled dialog result","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"druid-shell/src/backend/gtk/dialog.rs","lineNumber":104,"sourceCode":"    let result = dialog.run();\n\n    let result = match result {\n        ResponseType::Accept => match dialog.filenames() {\n            filenames if filenames.is_empty() => Err(anyhow!(\"No path received for filename\")),\n            // If we receive more than one file, but `multi_selection` is false, return an error.\n            filenames if filenames.len() > 1 && !options.multi_selection => {\n                Err(anyhow!(\"More than one path received for single selection\"))\n            }\n            // If we receive more than one file with a save action, return an error.\n            filenames if filenames.len() > 1 && action == FileChooserAction::Save => {\n                Err(anyhow!(\"More than one path received for save action\"))\n            }\n            filenames => Ok(filenames.into_iter().map(|p| p.into_os_string()).collect()),\n        },\n        ResponseType::Cancel => Err(anyhow!(\"Dialog was deleted\")),\n        _ => {\n            tracing::warn!(\"Unhandled dialog result: {:?}\", result);\n            Err(anyhow!(\"Unhandled dialog result\"))\n        }\n    };\n\n    // TODO properly handle errors into the Error type\n\n    dialog.destroy();\n\n    Ok(result?)\n}\n","sourceCodeStart":86,"sourceCodeEnd":114,"githubUrl":"https://github.com/linebender/druid/blob/0f8b1195e4e073f9597f2865299c3d18f8e4005f/druid-shell/src/backend/gtk/dialog.rs#L86-L114","documentation":"Catch-all error arm in get_file_dialog_path: the GTK dialog returned a ResponseType other than Accept (and other than the handled cancel/delete cases), so the result cannot be interpreted as a file selection. It fires when the chooser emits an unexpected response — a delete-event, an unhandled response id, or a GTK-internal response.","triggerScenarios":"Thrown at druid-shell/src/backend/gtk/dialog.rs:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Map ResponseType::Cancel/DeleteEvent explicitly to Ok(None) so only truly unknown responses hit this arm","Log the raw response value to diagnose which GTK response id arrived","Treat unknown responses as user cancellation and return None instead of a hard error"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0f8b1195e4e073f9597f2865299c3d18f8e4005f","analyzedAt":"2026-09-10T14:27:34.582Z","contentChangedAt":"2026-09-10T14:27:34.582Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}