Browse Source

d.mon: fix debug call

Anna Petrasova 5 years ago
parent
commit
3f2ea9c02e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      display/d.mon/render_cmd.py

+ 3 - 2
display/d.mon/render_cmd.py

@@ -5,6 +5,7 @@ import tempfile
 
 from grass.script import core as grass
 from grass.script import task as gtask
+from grass.exceptions import CalledModuleError
 
 # read environment variables from file
 def read_env_file(env_file):
@@ -39,8 +40,8 @@ def render(cmd, mapfile):
         env['GRASS_RENDER_FILE'] = mapfile
     try:
         grass.run_command(cmd[0], env=env, **cmd[1])
-    except Exception as e:
-        grass.debug(1, "Unable to render: {0}".format(e))
+    except CalledModuleError as e:
+        grass.debug("Unable to render: {0}".format(e), 1)
 
 # update cmd file
 def update_cmd_file(cmd_file, cmd, mapfile):