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

GRASS GIS trac at osgeo.org
Tue Nov 11 12:10:53 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 wenzeslaus):

 Replying to [comment:35 neteler]:
 > Replying to [comment:34 wenzeslaus]:
 > > `r.basin` is using function `error()` which is something different
 than function `fatal()`. `error()` just prints the message and continues,
 `fatal()` actually exits and raises. So, the behavior is correct according
 to implementation and is the same before r62566 and after r62705.
 >
 > Ah, I overlooked this difference. r.basin fixed in r62708, now it exits
 as expected in case a dependency wasn't installed yet.

 Yes, it might be confusing. C API has `G_fatal_error()` and Python API has
 `error()` and `fatal()`. I've tried to improve the documentation in trunk
 in r62709.

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



More information about the grass-dev mailing list