From 852f5c65cdf78c92012afcf9790d272b4e3f4419 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Thu, 16 May 2024 13:05:46 +0300 Subject: Pep8 Cleanup for llms/errors file --- gn3/llms/errors.py | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'gn3/llms') 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) -- cgit v1.2.3