Skip to content

Commit

Permalink
Add force_database_error documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhghomon committed Jan 5, 2024
1 parent 35a9388 commit 05b8a59
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/stdlib/cfg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,28 @@ Query behavior
UI session, so you won't have to remember to re-enable it when you're
done.

:eql:synopsis:`force_database_error -> str`
A hook to force all queries to produce an error. Defaults to 'false'.

.. note::

This parameter takes a ``str`` instead of a ``bool`` to allow more
verbose messages when all queries are forced to fail. The database will
attempt to deserialize this ``str`` into a JSON object that must include
a ``type`` (which must be an EdgeDB error type name), and may also
include ``message``, ``hint``, and ``details`` which can be set ad-hoc
by the user.

For example, the following is valid input:

``'{ "type": "QueryError",
"message": "Did not work",
"hint": "Try doing something else",
"details": "Indeed, something went really wrong" }'``

As is this:

``'{ "type": "UnknownParameterError" }'``

.. _ref_std_cfg_client_connections:

Expand Down

0 comments on commit 05b8a59

Please sign in to comment.