Skip to content

Throw error message when tar file is selected#128

Open
albreverman wants to merge 1 commit intomasterfrom
add-error-handling-for-non-snodas-tar-files
Open

Throw error message when tar file is selected#128
albreverman wants to merge 1 commit intomasterfrom
add-error-handling-for-non-snodas-tar-files

Conversation

@albreverman
Copy link
Contributor

Throw error message when non-SNODAS tar file is selected in the Importer utility.

Resolves: HMS-4582

}

if (path.endsWith(".tar")) {
throw new IllegalStateException("DataReader cannot parse non-SNODAS tar file");
Copy link
Collaborator

Choose a reason for hiding this comment

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

You're on the right track. I think that the end goal of this diff is to provide a more general and helpful message to the user, e.g. "An unrecognized tar file has been encountered. Try unarchiving the contents of the tar prior to import." Keep in mind that exception messages are usually targeted to developers. Let me know if you need any help connecting the dots to the end goal.

When a .tar, .tar.gz, or .zip file that is not a SNODAS dataset is used as input, DataReader now throws an UnrecognizedArchiveException instead of falling through to the NetCDF reader. The ImportMetWizard catches this exception and displays a user-friendly error message advising the user to extract the archive contents before import.

Resolves: HMS-4582
@tombrauer tombrauer force-pushed the add-error-handling-for-non-snodas-tar-files branch from 490a097 to b5cbc8f Compare February 23, 2026 18:57
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.

2 participants