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

GRASS GIS trac at osgeo.org
Wed Jun 25 14:24:17 PDT 2014


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

Comment(by glynn):

 Replying to [comment:12 wenzeslaus]:

 > Thus, I now think that the best solution is to create new functions (in
 different module but based on `start_command`) or to add a parameter to
 existing functions but something tells me that I will anyway create a
 wrapper function with the parameter set and creating new functions all
 over again was what was motivation for this ticket.

 I suggest adding an extra keyword parameter to control error checking. The
 default should be to generate an error (raise an exception or call
 fatal()) for a non-zero exit code.

 The value should be stored in the grass.script.Popen() object so that non-
 blocking functions (start_command, pipe_command, feed_command) behave
 consistently with blocking functions (run_command, read_command,
 write_command). I.e. the error-checking behaviour would always be
 specified in the call which creates the process regardless of whether that
 call waits for termination or returns a Popen object.

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



More information about the grass-dev mailing list