Skip to main content

get_error_hint

Function get_error_hint 

Source
pub fn get_error_hint(err: &Error, exit_code: CliExitCode) -> String
Expand description

Get context-aware hint based on error details and exit code

Provides enhanced hints for specific error categories, particularly for unsupported query features per M2_CLI_SPEC.md

§Examples

use anyhow::anyhow;
use cqlite_cli::error::{get_error_hint, classify_error};

let err = anyhow!("Unsupported query: JOIN not supported");
let exit_code = classify_error(&err);
let hint = get_error_hint(&err, exit_code);
assert!(hint.contains("Supported SELECT features"));