Refactor get_microagents_from_org_or_user error handling (#9865)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Graham Neubig 2025-07-23 10:35:48 -04:00 committed by GitHub
parent 7a168b9b5f
commit 00582a487c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,6 +49,7 @@ from openhands.integrations.provider import (
ProviderHandler,
ProviderType,
)
from openhands.integrations.service_types import AuthenticationError
from openhands.microagent import (
BaseMicroagent,
load_microagents_from_dir,
@ -701,12 +702,18 @@ fi
GENERAL_TIMEOUT,
org_openhands_repo,
)
except AuthenticationError as e:
self.log(
'debug',
f'org-level microagent directory {org_openhands_repo} not found: {str(e)}',
)
raise
except Exception as e:
self.log(
'error',
'debug',
f'Failed to get authenticated URL for {org_openhands_repo}: {str(e)}',
)
raise Exception(str(e))
raise
clone_cmd = (
f'GIT_TERMINAL_PROMPT=0 git clone --depth 1 {remote_url} {org_repo_dir}'
@ -762,6 +769,11 @@ fi
f'Clone command output: {clone_error_msg}',
)
except AuthenticationError as e:
self.log(
'debug',
f'org-level microagent directory {org_openhands_repo} not found: {str(e)}',
)
except Exception as e:
self.log(
'debug',