π OpenHands: AI-Driven Development
feat: merge identical url from different error messages (#1572)
Shimada66630de484d49c9
diff --git a/opendevin/const/guide_url.py b/opendevin/const/guide_url.pynew file mode 100644index 0000000000..80bb3cfa98--- /dev/null+++ b/opendevin/const/guide_url.py@@ -0,0 +1 @@+TROUBLESHOOTING_URL = 'https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting'diff --git a/opendevin/runtime/docker/exec_box.py b/opendevin/runtime/docker/exec_box.pyindex 9c4e325fb3..a65ef5ccff 100644--- a/opendevin/runtime/docker/exec_box.py+++ b/opendevin/runtime/docker/exec_box.py@@ -11,6 +11,7 @@ from typing import Dict, List, Tupleimport docker+from opendevin.const.guide_url import TROUBLESHOOTING_URLfrom opendevin.core import configfrom opendevin.core.exceptions import SandboxInvalidBackgroundCommandErrorfrom 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 exdiff --git a/opendevin/runtime/docker/ssh_box.py b/opendevin/runtime/docker/ssh_box.pyindex 9d1b8eec7f..f5f798eff7 100644--- a/opendevin/runtime/docker/ssh_box.py+++ b/opendevin/runtime/docker/ssh_box.py@@ -11,6 +11,7 @@ from typing import Dict, List, Tuple, Unionimport dockerfrom pexpect import pxssh+from opendevin.const.guide_url import TROUBLESHOOTING_URLfrom opendevin.core import configfrom opendevin.core.exceptions import SandboxInvalidBackgroundCommandErrorfrom 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 exdiff --git a/opendevin/server/agent/agent.py b/opendevin/server/agent/agent.pyindex d24de297a8..6d5f2a0f6c 100644--- a/opendevin/server/agent/agent.py+++ b/opendevin/server/agent/agent.py@@ -1,6 +1,7 @@import asynciofrom typing import Dict, List, Optional+from opendevin.const.guide_url import TROUBLESHOOTING_URLfrom opendevin.controller import AgentControllerfrom opendevin.controller.agent import Agentfrom 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..')returnawait self.init_done()