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

r.in.srtm: Fix exception handling and add specific error types #4571

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

arohanajit
Copy link
Contributor

Following Exceptions added

  • zipfile.BadFIle and zipfile.LArgeFile for file related errors. and PermissionError incase it does not have enough permission to be accessed
  • In second, since gs module is used, I added CalledModuleError, I can also do a generic Exception here if required

@github-actions github-actions bot added raster Related to raster data processing Python Related code is in Python module labels Oct 21, 2024
@nilason
Copy link
Contributor

nilason commented Oct 22, 2024

I don’t understand what is “temporal” with this PR?

@arohanajit arohanajit changed the title temporal: Fixed E722 in r.in.srtm scripts: Fixed E722 in r.in.srtm Oct 22, 2024
@arohanajit arohanajit changed the title scripts: Fixed E722 in r.in.srtm r.in.srtm: Fix exception handling and add specific error types Oct 22, 2024
@arohanajit
Copy link
Contributor Author

Yes, it shouldve been under r.*. I misclassified it

echoix
echoix previously approved these changes Oct 22, 2024
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

I went through the docs of zip file and the chosen exceptions make sense. ValueError shouldn't happen as we set the ".zip" extension. I didn't find PermissionError in the page, but it makes sense when opening a file.

So everything is fine with me!

@petrasovaa petrasovaa added this to the 8.5.0 milestone Oct 23, 2024
@petrasovaa petrasovaa enabled auto-merge (squash) October 23, 2024 17:47
@petrasovaa petrasovaa merged commit 3d7b331 into OSGeo:main Oct 23, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Python Related code is in Python raster Related to raster data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants