language models updated
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
from Services.Redis.Actions.actions import RedisActions
|
||||
|
||||
|
||||
class HTTPExceptionApi(Exception):
|
||||
|
||||
def __init__(self, error_code: str, lang: str, loc: str = "", sys_msg: str = ""):
|
||||
@@ -5,3 +8,11 @@ class HTTPExceptionApi(Exception):
|
||||
self.lang = lang
|
||||
self.loc = loc
|
||||
self.sys_msg = sys_msg
|
||||
|
||||
def retrieve_error_message_by_code_at_redis(self):
|
||||
"""
|
||||
Retrieve the error message from the redis by the error code.
|
||||
"""
|
||||
error_msg = RedisActions.get_json(list_keys=["LANGUAGE_MODELS", "ERRORCODES", self.lang])
|
||||
if error_msg.status:
|
||||
return error_msg.first
|
||||
|
||||
Reference in New Issue
Block a user