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

GRASS GIS trac at osgeo.org
Wed Nov 12 01:21:05 PST 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:34 wenzeslaus]:

 > I suppose that `g.message` behavior is advantageous for terminations of
 shell scripts using `set -e`. This makes `g.message` special comparing to
 other GRASS modules

 Not really ...

 Like (almost?) any other GRASS module, g.message returns a non-zero exit
 code if a fatal error was generated, and a zero exit code otherwise.

 g.message calls a different function (G_verbose_message(), G_warning()
 etc) depending upon the flag which was used (defaulting to G_message() if
 no flag was used). If the -e flag is used, it calls G_fatal_error(), hence
 the non-zero exit code.

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



More information about the grass-dev mailing list