From b9eb0757124d99032c6e19965a6e42094557eb31 Mon Sep 17 00:00:00 2001 From: Joey Chatelain Date: Thu, 12 Mar 2026 17:18:02 -0700 Subject: [PATCH] add error option to docs --- docs/brokers/create_dataservice.rst | 21 ++++++++++++++++++--- docs/common/customsettings.rst | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/brokers/create_dataservice.rst b/docs/brokers/create_dataservice.rst index d50d81c0b..f4ffe7797 100644 --- a/docs/brokers/create_dataservice.rst +++ b/docs/brokers/create_dataservice.rst @@ -111,6 +111,21 @@ to help you do this. This section will take you through the fundamentals to get :doc:`full class documentation <../api/tom_dataservices/data_services>` before you precede. +Using built in Errors and Exceptions +++++++++++++++++++++++++++++++++++++ +The TOM Toolkit includes a catch-all error method that will be useful to raise if you want to pass the information back +to the view when something doesn't go as expected: + +``QueryServiceError`` +===================== +Raising this error is useful for handling problems with query parameters or query feedback that +might cause issues further down the stack. + +.. code-block:: python + + raise QueryServiceError(f"Target '{target.name}' is not configured for {self.name}.") + + Filling out our ``MyServiceForm`` +++++++++++++++++++++++++++++++++ First, we will need actual fields in our Form. For more on this, see the `official Django @@ -422,9 +437,9 @@ This consists of adding the ``get_simple_form_partial()`` method to ``MyServiceF {% bootstrap_field form.first_field %} NOTES: - - Here we are just rendering a single field from our form. - - See the docs for `Django Form Templates `__ - and `bootstrap4 `__ for help building your partials. + * Here we are just rendering a single field from our form. + * See the docs for `Django Form Templates `__ + and `bootstrap4 `__ for help building your partials. Advanced Forms: =============== diff --git a/docs/common/customsettings.rst b/docs/common/customsettings.rst index 454988919..70711749b 100644 --- a/docs/common/customsettings.rst +++ b/docs/common/customsettings.rst @@ -166,7 +166,7 @@ Default: [] With an `AUTH_STRATEGY <#auth-strategy>`__ value of **LOCKED**, urls in this list will remain visible to unauthenticated users. You can also use wild cards to open an entire path. -You might add the homepage (‘/’), for example, or anything with a path that looks like '/accounts/reset/*/'. +You might add the homepage (‘/’), for example, or anything with a path that looks like ``'/accounts/reset/*/'``. `TARGET_PERMISSIONS_ONLY <#target-permissions-only>`__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~