[GRASS-dev] [GRASS GIS] #2326: Command functions in grass.script.core miss a correct error reporting

GRASS GIS trac at osgeo.org
Fri Jun 6 00:24:18 PDT 2014


#2326: Command functions in grass.script.core miss a correct error reporting
-------------------------+--------------------------------------------------
 Reporter:  wenzeslaus   |       Owner:  grass-dev@…              
     Type:  enhancement  |      Status:  new                      
 Priority:  normal       |   Milestone:  7.1.0                    
Component:  Python       |     Version:  svn-trunk                
 Keywords:  script       |    Platform:  All                      
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by glynn):

 Replying to [ticket:2326 wenzeslaus]:

 > The later is actually a motivation for this ticket because I see this as
 a critical issue which is very dangerous for
 [https://gis.stackexchange.com/questions/99773/problems-running-grass-
 mapcalc/ beginners] (writing scripts with `run_command` or others) and not
 checking the return code or stderr with an expectation that the function
 will report the error (in Python sense, thus raising an exception).

 Personally, I'd suggest just modifying the existing functions to raise
 exceptions if the command fails.

 Scripts which want to do their own error handling can just use
 start_command() directly; the higher-level functions are only trivial
 wrappers around this.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2326#comment:1>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list