Skip to content

Conversation

@philprime
Copy link
Member

Building an NSError object was a quick & dirty solution, so this PR introduces a proper Swift error type.

Closes #76

@philprime philprime self-assigned this Jan 7, 2026
Copilot AI review requested due to automatic review settings January 7, 2026 08:39
@philprime philprime enabled auto-merge (squash) January 7, 2026 08:39
Copy link
Contributor

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 the share extension error handling by introducing a proper Swift error enum (ShareExtensionError) to replace the previous NSError instantiation pattern. This improves type safety and follows Swift best practices for error handling.

Key Changes:

  • Added a new ShareExtensionError enum conforming to LocalizedError with a noValidURL case
  • Updated ShareViewController to use the new typed error instead of manually constructing NSError

Reviewed changes

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

File Description
Targets/ShareExtension/Sources/Utils/ShareExtensionError.swift Introduces new typed error enum with LocalizedError conformance for share extension error cases
Targets/ShareExtension/Sources/ShareViewController.swift Replaces NSError instantiation with new ShareExtensionError.noValidURL when no valid URL is found

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

@philprime philprime merged commit 1234fb8 into main Jan 7, 2026
5 checks passed
@philprime philprime deleted the share-extension-error branch January 7, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ShareExtensionError: Code: 0

2 participants