mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
handle 403s
This commit is contained in:
1 parent
cf29632261
commit
4ce51b3659
2 files changed
+16
No files matched your search
@@ -419,6 +419,16 @@ export class SessionManager {
|
||||
apiError.code = code;
|
||||
throw apiError;
|
||||
}
|
||||
if (error?.status === 403) {
|
||||
const code = 'key_limit_exceeded';
|
||||
const apiError = new OpenAI.APIError({
|
||||
status: error.status,
|
||||
code,
|
||||
message: `${error.status} Provider returned error`
|
||||
});
|
||||
apiError.code = code;
|
||||
throw apiError;
|
||||
}
|
||||
if (error?.status === 422) {
|
||||
const code = 'unprocessable_entity'
|
||||
const apiError = new OpenAI.APIError({
|
||||
|
||||
Reference in new issue
Block a user