Skip to content

Conversation

radu-mocanu
Copy link
Contributor

@radu-mocanu radu-mocanu commented Sep 17, 2025

Development Package

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

  # Any version from PR
  "uipath>=2.1.52.dev1005920000,<2.1.52.dev1005930000"
]

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

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

@radu-mocanu radu-mocanu added the build:dev Create a dev build from the pr label Sep 17, 2025
@radu-mocanu radu-mocanu requested a review from Copilot September 17, 2025 15:09
Copy link

@Copilot 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 fixes error handling in the attachments service by properly catching and re-raising the original EnrichedException instead of wrapping it in a generic Exception. The change ensures that specific error details and status codes are preserved when attachment download operations fail.

  • Replaces generic Exception handling with specific EnrichedException handling
  • Uses structured status code checking instead of string parsing for 404 errors
  • Preserves original exception details by re-raising the caught EnrichedException directly

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/uipath/_services/attachments_service.py Updated exception handling in both sync and async download methods to catch EnrichedException specifically and preserve original error details
pyproject.toml Version bump from 2.1.51 to 2.1.52

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

except EnrichedException as e:
# If not found in UiPath, check local storage
if "404" in str(e):
if e.status_code == 404:
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

The code assumes EnrichedException has a status_code attribute, but this may not always be the case. Consider adding a safety check like getattr(e, 'status_code', None) == 404 to prevent AttributeError if the exception doesn't have this attribute.

Suggested change
if e.status_code == 404:
if getattr(e, 'status_code', None) == 404:

Copilot uses AI. Check for mistakes.

except EnrichedException as e:
# If not found in UiPath, check local storage
if "404" in str(e):
if e.status_code == 404:
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

Same issue as in the sync version - the code assumes EnrichedException has a status_code attribute without checking. Consider adding a safety check like getattr(e, 'status_code', None) == 404 to prevent AttributeError.

Suggested change
if e.status_code == 404:
if getattr(e, 'status_code', None) == 404:

Copilot uses AI. Check for mistakes.

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.

1 participant