astral-sh/ruff · error

{}

Error message

{}

What it means

A generic anyhow wrapper around the error text produced while resolving a project's program settings (e.g. parsing ty.toml or the [tool.ty] table). The message body is the underlying error, so this record identifies where in ty_project::db the failure surfaced, not a specific cause of its own.

Solutions

  1. Read the wrapped error text to find the actual settings problem
  2. Fix the offending ty.toml / pyproject.toml entry and re-run
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/ty_project/src/db.rs:192 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astral-sh/ruff@15f3fe6b15 (2026-09-05). Data as JSON: /api/errors/2f00c6280e5aea25. Report an issue: GitHub.

Appendix: source

Thrown at crates/ty_project/src/db.rs:192

        //   cache and load the cache if it exists.
        //   we may want to have a dedicated method for this?
        // Important: For persistent caching it's essential that we can compute the
        // cache key before loading the DB. Because of that, access to the `db` (other than system and vendored) is
        // strictly forbidden before resolving the `program_settings`.

        let merged_options = project_metadata.to_merged_options();

        let (program_settings, program_settings_diagnostics) = strategy
            .to_anyhow(merged_options.to_program_settings(db.system(), db.vendored(), strategy))?;

        // This must be called before `from_metadata`, or the `SearchPath` root
        // will take precedence over the `Project` root, resulting in
        // all project files having HIGH durability.
        project_metadata.try_add_project_root(&db);

        let (settings, mut settings_diagnostics) = strategy
            .map_err(merged_options.to_settings(&db, strategy), |error| {
                anyhow::anyhow!("{}", error.pretty(&db))
            })?;
        settings_diagnostics.extend(
            program_settings_diagnostics
                .into_iter()
                .map(|diagnostic| diagnostic.into_diagnostic(&db)),
        );

        db.project = Some(Project::from_metadata(
            &db,
            project_metadata,
            settings,
            program_settings,
            settings_diagnostics,
        ));

        Ok(db)
    }

View on GitHub (pinned to 15f3fe6b15)