feat: merge identical url from different error messages (#1572)

This commit is contained in:
Shimada666 2024-05-05 03:55:10 +08:00 committed by GitHub
parent 718730a2b9
commit 30de484d49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1 @@
TROUBLESHOOTING_URL = 'https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting'

View File

@ -11,6 +11,7 @@ from typing import Dict, List, Tuple
import docker
from opendevin.const.guide_url import TROUBLESHOOTING_URL
from opendevin.core import config
from opendevin.core.exceptions import SandboxInvalidBackgroundCommandError
from opendevin.core.logger import opendevin_logger as logger
@ -56,7 +57,7 @@ class DockerExecBox(Sandbox):
self.docker_client = docker.from_env()
except Exception as ex:
logger.exception(
'Error creating controller. Please check Docker is running and visit `https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting` for more debugging information.',
f'Error creating controller. Please check Docker is running and visit `{TROUBLESHOOTING_URL}` for more debugging information.',
exc_info=False,
)
raise ex

View File

@ -11,6 +11,7 @@ from typing import Dict, List, Tuple, Union
import docker
from pexpect import pxssh
from opendevin.const.guide_url import TROUBLESHOOTING_URL
from opendevin.core import config
from opendevin.core.exceptions import SandboxInvalidBackgroundCommandError
from opendevin.core.logger import opendevin_logger as logger
@ -72,7 +73,7 @@ class DockerSSHBox(Sandbox):
self.docker_client = docker.from_env()
except Exception as ex:
logger.exception(
'Error creating controller. Please check Docker is running and visit `https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting` for more debugging information.',
f'Error creating controller. Please check Docker is running and visit `{TROUBLESHOOTING_URL}` for more debugging information.',
exc_info=False,
)
raise ex

View File

@ -1,6 +1,7 @@
import asyncio
from typing import Dict, List, Optional
from opendevin.const.guide_url import TROUBLESHOOTING_URL
from opendevin.controller import AgentController
from opendevin.controller.agent import Agent
from opendevin.core import config
@ -166,7 +167,7 @@ class AgentUnit:
except Exception as e:
logger.exception(f'Error creating controller: {e}')
await self.send_error(
'Error creating controller. Please check Docker is running and visit `https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting` for more debugging information..'
f'Error creating controller. Please check Docker is running and visit `{TROUBLESHOOTING_URL}` for more debugging information..'
)
return
await self.init_done()