pub fn hint(&self) -> Option<String> {
        match self {
            CoordError::AutomaticTimestampFailure {
                unmaterialized,
                disabled_indexes,
            } => {
                let unmaterialized_hint = if unmaterialized.is_empty() {
                    ""
                } else {
                    "\n- Use `SELECT ... AS OF` to manually choose a timestamp for your query.
- Create indexes on the listed unmaterialized sources or on the views derived from those sources"
                };
                let disabled_indexes_hint = if disabled_indexes.is_empty() {
                    ""
                } else {
                    "ALTER INDEX ... SET ENABLED to enable indexes"
                };

                Some(format!(
                    "{}{}{}",
                    unmaterialized_hint,
                    if !unmaterialized_hint.is_empty() {
                        "\n-"
                    } else {
                        ""
                    },
                    disabled_indexes_hint
                ))
            }
            CoordError::Catalog(c) => c.hint(),
            CoordError::Eval(e) => e.hint(),
            CoordError::InvalidAlterOnDisabledIndex(idx) => Some(format!(
                "To perform this ALTER, first enable the index using ALTER \
                INDEX {} SET ENABLED",
                idx.quoted()
            )),
            CoordError::UnknownLoginRole(_) => {
                // TODO(benesch): this will be a bad hint when people are used
                // to creating roles in Materialize, since they might drop the
                // default "materialize" role. Remove it in a few months
                // (say, April 2021) when folks are more used to using roles
                // with Materialize. (We don't want to do something more clever
                // and include the actual roles that exist in the message,
                // because that leaks information to unauthenticated clients.)
                Some("Try connecting as the \"materialize\" user.".into())
            }
            _ => None,
        }
    }
/// Reports a hint for the user about how the error could be fixed.
Reports a hint for the user about how the error could be fixed.
Reports a hint for the user about how the error could be fixed .
pub fn hint(&self) -> Option<String> {
        match self {
            CoordError::AutomaticTimestampFailure {
                unmaterialized,
                disabled_indexes,
            } => {
                let unmaterialized_hint = if unmaterialized.is_empty() {
                    ""
                } else {
                    "\n- Use `SELECT ... AS OF` to manually choose a timestamp for your query.
- Create indexes on the listed unmaterialized sources or on the views derived from those sources"
                };
                let disabled_indexes_hint = if disabled_indexes.is_empty() {
                    ""
                } else {
                    "ALTER INDEX ... SET ENABLED to enable indexes"
                };
                Some(format!(
                    "{}{}{}",
                    unmaterialized_hint,
                    if !unmaterialized_hint.is_empty() {
                        "\n-"
                    } else {
                        ""
                    },
                    disabled_indexes_hint
                ))
            }
            CoordError::Catalog(c) => c.hint(),
            CoordError::Eval(e) => e.hint(),
            CoordError::InvalidAlterOnDisabledIndex(idx) => Some(format!(
                "To perform this ALTER, first enable the index using ALTER \
                INDEX {} SET ENABLED",
                idx.quoted()
            )),
            CoordError::UnknownLoginRole(_) => {
                // TODO(benesch): this will be a bad hint when people are used
                // to creating roles in Materialize, since they might drop the
                // default "materialize" role. Remove it in a few months
                // (say, April 2021) when folks are more used to using roles
                // with Materialize. (We don't want to do something more clever
                // and include the actual roles that exist in the message,
                // because that leaks information to unauthenticated clients.)
                Some("Try connecting as the \"materialize\" user.".into())
            }
            _ => None,
        }
    }
pub fn hint ( & self ) -> Option < String > { match self { CoordError :: AutomaticTimestampFailure { unmaterialized , disabled_indexes , } => { let unmaterialized_hint = if unmaterialized . is_empty ( ) { " " } else { " \n " } ; let disabled_indexes_hint = if disabled_indexes . is_empty ( ) { " " } else { " " } ; Some ( format ! ( " " unmaterialized_hint if unmaterialized_hint is_empty ( ) { " \n " } else { " " } disabled_indexes_hint ) ) } CoordError :: Catalog ( c ) => c . hint ( ) , CoordError :: Eval ( e ) => e . hint ( ) , CoordError :: InvalidAlterOnDisabledIndex ( idx ) => Some ( format ! ( " \
 " idx quoted ( ) ) ) , CoordError :: UnknownLoginRole ( _ ) => { // TODO(benesch): this will be a bad hint when people are used // to creating roles in Materialize, since they might drop the // default "materialize" role. Remove it in a few months // (say, April 2021) when folks are more used to using roles // with Materialize. (We don't want to do something more clever // and include the actual roles that exist in the message, // because that leaks information to unauthenticated clients.) Some ( " \" \" " . into ( ) ) } _ => None , } }
Reports a hint for the user about how the error could be fixed.
Reports a hint for the user about how the error could be fixed .
&self
&self