aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
Diffstat (limited to 'gn3')
-rw-r--r--gn3/llms/errors.py26
1 files changed, 3 insertions, 23 deletions
diff --git a/gn3/llms/errors.py b/gn3/llms/errors.py
index e9f7c02..af3d7b0 100644
--- a/gn3/llms/errors.py
+++ b/gn3/llms/errors.py
@@ -1,32 +1,11 @@
-
-# pylint: skip-file
+""" Error handlers for Fahamu Api"""
import json
-
from requests import HTTPError
class UnprocessableEntity(HTTPError):
- """An HTTP 422 Unprocessable Entity error occurred.
-
+ """Error for HTTP 422 Unprocessable Entity
https://help.helpjuice.com/en_US/api-v3/api-v3#errors
-
- The request could not be processed, usually due to a missing or invalid parameter.
-
- The response will also include an error object with an explanation of fields that
- are missing or invalid. Here is an example:
-
- .. code-block::
-
- HTTP/1.1 422 Unprocessable Entity
-
-
- {
- "errors": [
- {
- "email": "is not valid."
- }
- ]
- }
"""
def __init__(self, request, response):
@@ -57,6 +36,7 @@ class UnprocessableEntity(HTTPError):
class LLMError(HTTPError):
+ """Custom error from making Fahamu APi request """
def __init__(self, request, response, msg):
super(HTTPError, self).__init__(
msg, request=request, response=response)