Skip to content

Comments

grass.script: Add more parameters to handle_errors#5875

Merged
wenzeslaus merged 7 commits intoOSGeo:mainfrom
wenzeslaus:explicit-handler-parameter-for-handle_errors
Jun 24, 2025
Merged

grass.script: Add more parameters to handle_errors#5875
wenzeslaus merged 7 commits intoOSGeo:mainfrom
wenzeslaus:explicit-handler-parameter-for-handle_errors

Conversation

@wenzeslaus
Copy link
Member

This add handler, stderr, and env to gs.handle_errors. This allows construction of better exception message and calling g.message with gs.fatal. Otherwise, it follows the same rules as error passed with the explicit kwargs dict parameter. Using stderr and handler to reduce confusion. errors is name of the type of handling in gs.handle_errors, but also the error messages in CalledModuleError.

This add handler, stderr, and env to gs.handle_errors. This allows construction of better exception message and calling g.message with gs.fatal. Otherwise, it follows the same rules as error passed with the explicit kwargs dict parameter. Using stderr and handler to reduce confusion. errors is name of the type of handling in gs.handle_errors, but also the error messages in CalledModuleError.
@github-actions github-actions bot added Python Related code is in Python libraries tests Related to Test Suite labels Jun 11, 2025
@echoix
Copy link
Member

echoix commented Jun 11, 2025

Is it possible that the new test file isn't run, as the file name doesn't start with test_ or end with _test?

@echoix
Copy link
Member

echoix commented Jun 20, 2025

Is it possible that the new test file isn't run, as the file name doesn't start with test_ or end with _test?

Yep, the test wasn't in the list of tests passed or failed.

Also, some conflicts in the docstrings to handle

@echoix echoix added the conflicts/needs rebase Rebase to or merge with the latest base branch is needed label Jun 20, 2025
@echoix echoix removed the conflicts/needs rebase Rebase to or merge with the latest base branch is needed label Jun 22, 2025
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.

This one is now ready to go. I have seen the test fail, then passed once fixed.

@echoix
Copy link
Member

echoix commented Jun 23, 2025

@wenzeslaus I’m letting you write the commit message and merge

@wenzeslaus wenzeslaus merged commit f01da9f into OSGeo:main Jun 24, 2025
27 checks passed
@wenzeslaus wenzeslaus deleted the explicit-handler-parameter-for-handle_errors branch June 24, 2025 13:19
@wenzeslaus
Copy link
Member Author

I just hit the need for this yesterday when working on tests - I got the "g.message not found" message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants