{"record":{"id":"0a0ad05938bc3f10","repo":"linebender/druid","slug":"more-than-one-path-received-for-save-action","errorCode":null,"errorMessage":"More than one path received for save action","messagePattern":"More than one path received for save action","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"druid-shell/src/backend/gtk/dialog.rs","lineNumber":97,"sourceCode":"        }\n    }\n\n    if let Some(default_name) = &options.default_name {\n        dialog.set_current_name(default_name);\n    }\n\n    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":79,"sourceCodeEnd":114,"githubUrl":"https://github.com/linebender/druid/blob/0f8b1195e4e073f9597f2865299c3d18f8e4005f/druid-shell/src/backend/gtk/dialog.rs#L79-L114","documentation":"Validation error returned by get_file_dialog_path on GTK: the file chooser dialog was closed with ResponseType::Accept but returned more than one filename while the request was for a single-selection (or non-save) operation, so the result cannot be represented as one path. It fires when the dialog's multi_selection option mismatches how the user selected files or when options.multi_selection is false but multiple files were chosen.","triggerScenarios":"Thrown at druid-shell/src/backend/gtk/dialog.rs:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set multi_selection: true in FileDialogOptions when the user should be able to pick multiple files","Use the open/multi-open dialog API variant when multiple paths are expected","Take only the first filename if a single path is acceptable, instead of erroring"],"exampleFix":null,"handlingStrategy":"validation","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"}