-
-
Notifications
You must be signed in to change notification settings - Fork 377
Open
Description
Note
The pull request "chore: Add try? linter for tests and fix current cases" was created by @itaybre but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.
📜 Description
This PR adds a custom SwiftLint rule to prevent the use of try? (optional try) in test files and fixes all existing occurrences in the codebase.
If we need to use try? in some cases, we can use // swiftlint:disable:next no_try_optional_in_tests
💡 Motivation and Context
Using try? in tests is problematic because it silently converts errors into nil, which can:
- Hide actual failures in test setup or execution
- Make tests pass when they should fail
- Make debugging harder when something goes wrong
By enforcing explicit error handling with try, tests will fail immediately and clearly when errors occur, improving test reliability and debuggability.
💚 How did you test it?
📝 Checklist
You have to check all boxes before merging:
- I added tests to verify the changes.
- No new PII added or SDK only sends newly added PII if
sendDefaultPIIis enabled. - I updated the docs if needed.
- I updated the wizard if needed.
- Review from the native team if needed.
- No breaking change or entry added to the changelog.
- No breaking change for hybrid SDKs or communicated to hybrid SDKs.
Metadata
Metadata
Assignees
Labels
No labels