Skip to content

fix: restore standard promise rejection and revert breaking error handling#81

Merged
RaphaelWoude merged 3 commits into
RaphaelWoude:mainfrom
fabiomartino:upd/dependencies
Mar 17, 2026
Merged

fix: restore standard promise rejection and revert breaking error handling#81
RaphaelWoude merged 3 commits into
RaphaelWoude:mainfrom
fabiomartino:upd/dependencies

Conversation

@fabiomartino
Copy link
Copy Markdown
Contributor

Summary

This PR reverts the temporary error handling strategy introduced for Capacitor v8 and restores the standard Promise rejection behavior using call.reject().

The previous "breaking change" assumption—which forced all methods to resolve with a { success: false } object—was based on a known upstream issue with Swift Package Manager (capacitor-swift-pm #33). This issue is now resolved in the supported Capacitor v8 / Xcode 26 toolchain.

Changes

  • Standardized Error Handling: Replaced the manual resolveError patterns with native call.reject() on both Android and iOS.
  • JS API Consistency: Restored the ability for developers to use try/catch blocks in JavaScript, aligning the plugin with Capacitor's normative architectural rules.
  • Code Cleanup: Removed internal success flags from result objects that were only used for error reporting.
  • Environment Alignment: Verified implementation against the mandatory Xcode 26 requirements for Capacitor v8 plugins.

@RaphaelWoude
Copy link
Copy Markdown
Owner

Hey, thanks for contributing again. I will take a look tomorrow night.

@fabiomartino
Copy link
Copy Markdown
Contributor Author

Hey, thanks for contributing again. I will take a look tomorrow night.

The build fails... probably you need to update your CI... cap8 need xCode26+

@RaphaelWoude
Copy link
Copy Markdown
Owner

Looking at it

Copy link
Copy Markdown
Owner

@RaphaelWoude RaphaelWoude left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for your contribution once again. Much appreciated.
I will update the BREAKING changes MD again.

@RaphaelWoude RaphaelWoude merged commit b3b7430 into RaphaelWoude:main Mar 17, 2026
4 checks passed
@RaphaelWoude
Copy link
Copy Markdown
Owner

Live in v8.1.0

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.

2 participants