From 9b8aaca8d69b67274cabdb315a73cc6b4130036b Mon Sep 17 00:00:00 2001
From: bigbes <bigbes@gmail.com>
Date: Fri, 3 Apr 2015 17:26:31 +0300
Subject: [PATCH] Add errcode directive

---
 doc/sphinx/book/app_a_errcodes.rst            | 37 +++++++++++--------
 .../cfg-binary_logging_snapshots.rst          | 10 ++---
 doc/sphinx/book/configuration/cfg-storage.rst |  2 +-
 doc/sphinx/ext/custom.py                      |  3 ++
 4 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/doc/sphinx/book/app_a_errcodes.rst b/doc/sphinx/book/app_a_errcodes.rst
index 6034e2acf6..f7529594e5 100644
--- a/doc/sphinx/book/app_a_errcodes.rst
+++ b/doc/sphinx/book/app_a_errcodes.rst
@@ -11,46 +11,53 @@ descriptions of some popular codes. A complete list of errors can be found in fi
 
 .. _errcode.h: https://github.com/tarantool/tarantool/blob/master/src/box/errcode.h
 
-.. _ER_MEMORY_ISSUE:
-
 ===========================================================
                 List of error codes
 ===========================================================
 
-ER_NONMASTER
+.. errcode:: ER_NONMASTER
+
     Can't modify data on a replication slave.
 
-ER_ILLEGAL_PARAMS
+.. errcode:: ER_ILLEGAL_PARAMS
+
     Illegal parameters. Malformed protocol message.
 
-ER_MEMORY_ISSUE
+.. errcode:: ER_MEMORY_ISSUE
+
     Out of memory: :confval:`slab_alloc_arena` limit is reached.
 
-ER_WAL_IO
+.. errcode:: ER_WAL_IO
+
     Failed to write to disk. May mean: failed to record a change in the
     write-ahead log. Some sort of disk error.
 
-ER_KEY_PART_COUNT
+.. errcode:: ER_KEY_PART_COUNT
+
     Key part count is not the same as index part count
 
-ER_NO_SUCH_SPACE
+.. errcode:: ER_NO_SUCH_SPACE
+
     Attempt to access a space that does not exist.
 
-ER_NO_SUCH_INDEX
+.. errcode:: ER_NO_SUCH_INDEX
+
     The specified index does not exist for the specified space.
 
-ER_PROC_LUA
+.. errcode:: ER_PROC_LUA
+
     An error inside a Lua procedure.
 
-ER_FIBER_STACK
+.. errcode:: ER_FIBER_STACK
+
     Recursion limit reached when creating a new fiber. This is usually an
     indicator of a bug in a stored procedure, recursively invoking itself
     ad infinitum.
 
-ER_UPDATE_FIELD
-    An error occurred during update of a field.
+.. errcode:: ER_UPDATE_FIELD
 
-ER_TUPLE_FOUND
-    Duplicate key exists in unique index ...
+    An error occurred during update of a field.
 
+.. errcode:: ER_TUPLE_FOUND
 
+    Duplicate key exists in unique index ...
diff --git a/doc/sphinx/book/configuration/cfg-binary_logging_snapshots.rst b/doc/sphinx/book/configuration/cfg-binary_logging_snapshots.rst
index 31d84f4dd9..6099f1c8b6 100644
--- a/doc/sphinx/book/configuration/cfg-binary_logging_snapshots.rst
+++ b/doc/sphinx/book/configuration/cfg-binary_logging_snapshots.rst
@@ -43,11 +43,11 @@
 
     Specify fiber-WAL-disk synchronization mode as:
 
-    * none: write-ahead log is not maintained;
-    * write: fibers wait for their data to be written to
-             the write-ahead log (no :manpage:`fsync(2)`);
-    * fsync: fibers wait for their data, :manpage:`fsync(2)`
-             follows each :manpage:`write(2)`;
+    * ``none``: write-ahead log is not maintained;
+    * ``write``: fibers wait for their data to be written to
+      the write-ahead log (no :manpage:`fsync(2)`);
+    * ``fsync``: fibers wait for their data, :manpage:`fsync(2)`
+      follows each :manpage:`write(2)`;
 
     Type: string |br|
     Default: "write" |br|
diff --git a/doc/sphinx/book/configuration/cfg-storage.rst b/doc/sphinx/book/configuration/cfg-storage.rst
index 9f17a879e4..042e26c4c6 100644
--- a/doc/sphinx/book/configuration/cfg-storage.rst
+++ b/doc/sphinx/book/configuration/cfg-storage.rst
@@ -2,7 +2,7 @@
 
     How much memory Tarantool allocates to actually store tuples, in gigabytes.
     When the limit is reached, INSERT or UPDATE requests begin failing with
-    error :ref:`ER_MEMORY_ISSUE`. While the server does not go beyond the defined
+    error :errcode:`ER_MEMORY_ISSUE`. While the server does not go beyond the defined
     limit to allocate tuples, there is additional memory used to store indexes
     and connection information. Depending on actual configuration and workload,
     Tarantool can consume up to 20% more than the limit set here.
diff --git a/doc/sphinx/ext/custom.py b/doc/sphinx/ext/custom.py
index 1de72ba877..9bf8e0a9ae 100644
--- a/doc/sphinx/ext/custom.py
+++ b/doc/sphinx/ext/custom.py
@@ -17,4 +17,7 @@ def setup(app):
     app.add_object_type('confval', 'confval',
                         objname='configuration value',
                         indextemplate='pair: %s; configuration value')
+    app.add_object_type('errcode', 'errcode',
+                        objname='error code value',
+                        indextemplate='pair: %s; error code value')
     return {'version': '0.0.2', 'parallel_read_safe': True}
-- 
GitLab