Browse Source

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

Shimada666 1 năm trước cách đây
mục cha
commit
30de484d49

+ 1 - 0
opendevin/const/guide_url.py

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

+ 2 - 1
opendevin/runtime/docker/exec_box.py

@@ -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

+ 2 - 1
opendevin/runtime/docker/ssh_box.py

@@ -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

+ 2 - 1
opendevin/server/agent/agent.py

@@ -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()