Переглянути джерело

pythonlib: describe more error and fatal functions

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62709 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 10 роки тому
батько
коміт
045fd45c46
1 змінених файлів з 8 додано та 2 видалено
  1. 8 2
      lib/python/script/core.py

+ 8 - 2
lib/python/script/core.py

@@ -571,15 +571,21 @@ def warning(msg):
 def error(msg):
     """Display an error message using `g.message -e`
 
+    This function does not end the execution of the program.
+    The right action after the error is up to the caller.
+    For error handling using the standard mechanism use :func:`fatal`.
+
     :param str msg: error message to be displayed
     """
     message(msg, flag='e')
 
 
 def fatal(msg):
-    """Display an error message using `g.message -e`, then abort
+    """Display an error message using `g.message -e`, then abort or raise
 
-    Raise exception when raise_on_error is 'True'.
+    Raises exception when module global raise_on_error is 'True', abort
+    (calls exit) otherwise.
+    Use func:`set_raise_on_error` to set the behavior.
 
     :param str msg: error message to be displayed
     """