Skip to content

improve error message when a component model isn't found #1938

Description

@juliasloan25

Right now we have an input verification that checks that the requested component model type is available based on the extensions that are loaded. This results in errors like the following when e.g. the ClimaAtmos extension isn't loaded:

ERROR: LoadError: Unknown atmosphere model type: climaatmos. Valid options are: :climaatmos
--
  | Stacktrace:
  | [1] error(s::String)
  | @ Base ./error.jl:35
  | [2] AtmosSimulation(::Val{…}; kwargs::@Kwargs{…})
  | @ ClimaCoupler.Interfacer /resnick/scratch/esm/slurm-buildkite/climacoupler-ci/8899/climacoupler-ci/src/Interfacer.jl:749
  | [3] CoupledSimulation(config_dict::Dict{Any, Any})
  | @ ClimaCoupler.SimCoordinator /resnick/scratch/esm/slurm-buildkite/climacoupler-ci/8899/climacoupler-ci/src/SimCoordinator.jl:277
  | [4] setup_and_run(config_dict::Dict{Any, Any})
  | @ ClimaCoupler.SimCoordinator /resnick/scratch/esm/slurm-buildkite/climacoupler-ci/8899/climacoupler-ci/src/SimCoordinator.jl:534
  | [5] top-level scope
  | @ /resnick/scratch/esm/slurm-buildkite/climacoupler-ci/8899/climacoupler-ci/experiments/test/restart_state_only.jl:55

This is confusing because the proposed valid option is the same as what the user requested. A more descriptive error message would suggest to the user to verify that all extensions loaded correctly when this happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions