Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for undownloadable artifacts #139

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

ph-kev
Copy link
Member

@ph-kev ph-kev commented Dec 10, 2024

closes #106 - This PR adds a message to the already existing error message that the artifact may be undownloadable and suggests to manually download the artifact and adds the artifact to Overrides.toml if this is the case. We do not check if the artifact is undownloadable.

The error message now look like this even if the artifact is downloadable for whatever reason:

ERROR: Artifact "era5_monthly_averages_pressure_levels_1979_2024" was not found by looking in the paths:
  ~/.julia/artifacts/dd7ee9500805f590f8fc4c00bfc373eeb7a01587
  ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/local/share/julia/artifacts/dd7ee9500805f590f8fc4c00bfc373eeb7a01587
  ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/artifacts/dd7ee9500805f590f8fc4c00bfc373eeb7a01587
Try `using Pkg; Pkg.instantiate()` to re-install all missing resources if the artifact is part of a package or call `Pkg.ensure_artifact_installed` (https://pkgdocs.julialang.org/v1/api/#Pkg.Artifacts.ensure_artifact_installed) if not.
The artifact may also be too large to download. If this is the case, download the files directly and indicate where the file lives in Overrides.toml (see ClimaArtifacts documentation for how to do this).

@ph-kev ph-kev marked this pull request as draft December 10, 2024 19:23
@ph-kev ph-kev force-pushed the kp/undownloadable-error branch from 196569b to e2cee74 Compare December 10, 2024 19:27
@ph-kev ph-kev marked this pull request as ready for review December 10, 2024 19:30
@ph-kev ph-kev force-pushed the kp/undownloadable-error branch from e2cee74 to e992b83 Compare December 10, 2024 19:33
@ph-kev ph-kev requested a review from Sbozzolo December 10, 2024 23:44
)::String
catch e
if e isa ErrorException
msg = "\nThe artifact may also be too large to download. If this is the case, download the artifact directly and indicate where the artifact lives in Overrides.toml (see ClimaArtifacts documentation for how to do this)."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg = "\nThe artifact may also be too large to download. If this is the case, download the artifact directly and indicate where the artifact lives in Overrides.toml (see ClimaArtifacts documentation for how to do this)."
msg = "\nThe artifact may also be too large to be downloaded automatically. If this is the case, download the artifact directly and indicate where the artifact lives in Overrides.toml (see ClimaArtifacts documentation for how to do this)."

@@ -135,19 +159,15 @@ macro clima_artifact(name, context = nothing)
$(platform),
LazyArtifacts,
)::String
catch e
if e isa ErrorException
msg = "\nThe artifact may also be too large to download. If this is the case, download the artifact directly and indicate where the artifact lives in Overrides.toml (see ClimaArtifacts documentation for how to do this)."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg = "\nThe artifact may also be too large to download. If this is the case, download the artifact directly and indicate where the artifact lives in Overrides.toml (see ClimaArtifacts documentation for how to do this)."
msg = "\nThe artifact may also be too large to be downloaded automatically. If this is the case, download the artifact directly and indicate where the artifact lives in Overrides.toml (see ClimaArtifacts documentation for how to do this)."

This commit adds a message to the already existing error message that
the artifact may be undownloadable and suggests to manually download
the artifact and adds the artifact to Overrides.toml if this is the case.
@ph-kev ph-kev force-pushed the kp/undownloadable-error branch from e992b83 to e4a1189 Compare December 11, 2024 19:34
@ph-kev ph-kev merged commit 83a676b into main Dec 16, 2024
27 checks passed
@ph-kev ph-kev deleted the kp/undownloadable-error branch December 16, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhelpful error message for ClimaArtifact
2 participants