Skip to content

Commit 8519879

Browse files
Add note about error handling in triggers (#1804)
1 parent ac88f49 commit 8519879

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rst/topics/error-handling.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ Almost all errors in Cartridge follow the ``return nil, err`` style, where
1010
doesn't raise errors except for bugs and functions contracts mismatch.
1111
Developing new roles should follow these guidelines as well.
1212

13+
Note that in triggers (``cartridge.graphql.on_resolve`` and
14+
``cartridge.twophase.on_patch``) return values are ignored.
15+
So if you want to raise error from trigger function, you need to
16+
call ``error()`` explicitly.
17+
1318
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1419
Error objects in Lua
1520
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)