-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: forwarder layer exception handling
- Loading branch information
Showing
3 changed files
with
70 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
|
||
class QueryHandlingError(Exception): | ||
|
||
status_code: int | ||
code: str | ||
message: str | ||
type: str | ||
param: str | ||
|
||
def __init__(self, status_code: int, code: str, message: str, type: str=None, param: str=None): | ||
"""Raise this exception when the query handling failed. | ||
Args: | ||
code (int): The http status code that should be returned to the client, please refer to the OpenAI API document. | ||
message (str): The error message that should be returned to the client. | ||
type (str): The error type that should be returned to the client. | ||
param (str): The error param that should be returned to the client. | ||
""" | ||
self.status_code = status_code | ||
self.code = code | ||
self.message = message | ||
self.type = type | ||
self.param = param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters