Skip to content

Conversation

@radugheo
Copy link
Collaborator

@radugheo radugheo commented Nov 4, 2025

This PR fixes unhandled exceptions during the session.initialize() step. Previously, only asyncio.TimeoutError was caught, causing other errors to go uncaught. As a result, the client would receive a misleading message:

❌ The server process failed to initialize. Verify environment variables are set correctly.

With this change, all initialization errors are now properly caught and handled, ensuring a more accurate error reporting.

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath-mcp==0.0.105.dev1001530156",

  # Any version from PR
  "uipath-mcp>=0.0.105.dev1001530000,<0.0.105.dev1001540000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-mcp = { index = "testpypi" }

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors error handling in the server initialization process to improve code clarity and exception chaining. The changes simplify the initialization logic by removing the explicit success tracking flag and consolidating exception handling.

Key changes:

  • Removed the initialization_successful flag in favor of simpler exception-based control flow
  • Simplified exception handling from except* syntax to standard exception handling
  • Added proper exception chaining with from e clause

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@radugheo radugheo added the build:dev Create a dev build from the pr label Nov 4, 2025
@radugheo radugheo requested a review from cristipufu November 4, 2025 11:39
@radugheo radugheo force-pushed the fix/runtime-error-handling branch 2 times, most recently from 4c51e47 to 818bf4c Compare November 4, 2025 12:48
@radugheo radugheo force-pushed the fix/runtime-error-handling branch from a8876f3 to 3ac1c0d Compare November 4, 2025 15:29
@radugheo radugheo changed the title fix: runtime error handliing fix: runtime error handling Nov 4, 2025
@radugheo radugheo force-pushed the fix/runtime-error-handling branch from 3ac1c0d to 45ad54f Compare November 4, 2025 15:41
@radugheo radugheo force-pushed the fix/runtime-error-handling branch 2 times, most recently from 9e920c0 to a093f98 Compare November 4, 2025 15:48
@radugheo radugheo requested a review from cristipufu November 4, 2025 15:49
@radugheo radugheo force-pushed the fix/runtime-error-handling branch from a093f98 to a372889 Compare November 4, 2025 16:27
@radugheo radugheo force-pushed the fix/runtime-error-handling branch from a372889 to 2392a96 Compare November 5, 2025 11:37
@radugheo radugheo merged commit 12e0861 into main Nov 5, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants