grass icon indicating copy to clipboard operation
grass copied to clipboard

grass.script: Add more parameters to handle_errors

Open wenzeslaus opened this issue 6 months ago • 1 comments

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.

wenzeslaus avatar Jun 11 '25 13:06 wenzeslaus

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 avatar Jun 11 '25 17:06 echoix

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 avatar Jun 20 '25 15:06 echoix

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

echoix avatar Jun 23 '25 14:06 echoix

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

wenzeslaus avatar Jun 24 '25 13:06 wenzeslaus