catch error from proxy server

This commit is contained in:
Nate Sesti 2023-06-26 13:54:26 -07:00
parent 45601fdd7c
commit 973bf1cff9
5 changed files with 7 additions and 3 deletions

View file

@ -2,6 +2,8 @@ from functools import cached_property
import traceback
import time
from typing import Any, Callable, Coroutine, Dict, List
from aiohttp import ClientPayloadError
from ..models.filesystem_edit import FileEditWithFullContents
from ..libs.llm import LLM
from .observation import Observation, InternalErrorObservation
@ -27,6 +29,8 @@ def get_error_title(e: Exception) -> str:
return "OpenAI timed out. Please try again."
elif isinstance(e, openai_errors.InvalidRequestError) and e.code == "context_length_exceeded":
return e._message
elif isinstance(e, ClientPayloadError):
return "The request to OpenAI failed. Please try again."
return e.__repr__()

View file

@ -1,12 +1,12 @@
{
"name": "continue",
"version": "0.0.65",
"version": "0.0.67",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
"version": "0.0.65",
"version": "0.0.67",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",

View file

@ -14,7 +14,7 @@
"displayName": "Continue",
"pricing": "Free",
"description": "Accelerating software development with language models",
"version": "0.0.65",
"version": "0.0.67",
"publisher": "Continue",
"engines": {
"vscode": "^1.74.0"