Skip to content

Conversation

@josxha
Copy link
Owner

@josxha josxha commented Nov 1, 2025

  • Ios catch objc exceptions (parseExpression() exceptions coming from C++, so most won't get catched)
  • improve parseException()

@josxha josxha added this to the v0.3.1 milestone Nov 1, 2025
Copilot AI review requested due to automatic review settings November 1, 2025 22:51
@github-project-automation github-project-automation bot moved this to Backlog in maplibre dev Nov 1, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 1, 2025

Deploying flutter-maplibre with  Cloudflare Pages  Cloudflare Pages

Latest commit: f212c44
Status: ✅  Deploy successful!
Preview URL: https://0e2e69ef.flutter-maplibre.pages.dev
Branch Preview URL: https://ios-catch-objc-exceptions.flutter-maplibre.pages.dev

View logs

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 error handling in the iOS helper methods by replacing Swift's do-catch blocks with Objective-C exception catching using the CwlCatchException library. This change addresses the fact that setValue(forKey:) can throw Objective-C exceptions rather than Swift errors, which cannot be caught by Swift's native error handling.

  • Integrated CwlCatchException library for proper Objective-C exception handling
  • Refactored parseExpression() to use early returns and a result variable pattern
  • Enhanced error messages with warning emoji and more descriptive context

Reviewed Changes

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

File Description
Helpers.swift Replaced Swift do-catch with NSException.catchException for proper Objective-C exception handling; improved error messages and control flow in parseExpression()
Package.swift Added CwlCatchException dependency to Swift Package Manager configuration
maplibre_ios.podspec Added CwlCatchException dependency to CocoaPods specification

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

Copilot AI review requested due to automatic review settings November 1, 2025 22:59
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

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


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

@josxha josxha enabled auto-merge (squash) November 1, 2025 23:05
Copilot AI review requested due to automatic review settings November 1, 2025 23:12
@josxha josxha disabled auto-merge November 1, 2025 23:12
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

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


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

Comment on lines +59 to +65
if let keyword = offset.first as? String,
keyword == "literal",
offset.count == 2,
let vector = offset.last as? [Any],
vector.count == 2,
let x = vector.first as? Double,
let y = vector.last as? Double
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The nested conditional chain for parsing vector literals is difficult to follow. Consider extracting this logic into a separate helper method like parseVectorLiteral(from: [Any]) -> NSExpression? to improve readability and testability.

Copilot uses AI. Check for mistakes.
@josxha josxha enabled auto-merge (squash) November 1, 2025 23:16
@josxha josxha merged commit 501251f into main Nov 1, 2025
21 of 23 checks passed
@josxha josxha deleted the ios-catch-objc-exceptions branch November 1, 2025 23:18
@github-project-automation github-project-automation bot moved this from Backlog to Done in maplibre dev Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants