[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 03:32:52 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 neteler):

 The new implementation still shows an issue:
 {{{
 GRASS 7.1.svn (nc_spm_08_grass7):~ > g.extension r.basin

 GRASS 7.1.svn (nc_spm_08_grass7):~ > r.basin map=elevation prefix=my_basin
 coord=637500.0,221750.0 dir=/tmp/bla threshold=1000
 WARNING: 'r.hypso' required. Please install 'r.hypso' first using
          'g.extension r.hypso'
 WARNING: 'r.stream.basins' required. Please install 'r.stream.basins'
 first
          using 'g.extension r.stream.basins'
 WARNING: 'r.stream.distance' required. Please install 'r.stream.distance'
          first using 'g.extension r.stream.distance'
 WARNING: 'r.stream.order' required. Please install 'r.stream.order' first
          using 'g.extension r.stream.order'
 WARNING: 'r.stream.snap' required. Please install 'r.stream.snap' first
          using 'g.extension r.stream.snap'
 WARNING: 'r.stream.stats' required. Please install 'r.stream.stats' first
          using 'g.extension r.stream.stats'
 WARNING: 'r.width.funct' required. Please install 'r.width.funct' first
          using 'g.extension r.width.funct'
 ERROR: An ERROR occurred running r.basin
 Traceback (most recent call last):
   File "/home/neteler/.grass7/addons/scripts/r.basin", line 836, in
 <module>
     sys.exit(main())
   File "/home/neteler/.grass7/addons/scripts/r.basin", line 94, in main
     check_progs()
   File "/home/neteler/.grass7/addons/scripts/r.basin", line 90, in
 check_progs
     grass.error(_("An ERROR occurred running r.basin"))
   File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-
 gnu/etc/python/grass/script/core.py", line 579, in error
     message(msg, flag='e')
   File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-
 gnu/etc/python/grass/script/core.py", line 517, in message
     run_command("g.message", flags=flag, message=msg)
   File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-
 gnu/etc/python/grass/script/core.py", line 361, in run_command
     returncode=returncode)
 grass.exceptions.CalledModuleError: Module run None g.message -e
 message=An ERROR occurred running r.basin ended with error
 Process ended with non-zero return code 1. See errors in the (error)
 output.
 }}}

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



More information about the grass-dev mailing list