Skip to content

Bug 2022743: Use 'async' for NimbusInterface.recordEventOrThrow [ci full]#7267

Open
moztcampbell wants to merge 1 commit intomozilla:mainfrom
moztcampbell:push-mzplypzvzxwu
Open

Bug 2022743: Use 'async' for NimbusInterface.recordEventOrThrow [ci full]#7267
moztcampbell wants to merge 1 commit intomozilla:mainfrom
moztcampbell:push-mzplypzvzxwu

Conversation

@moztcampbell
Copy link
Collaborator

In order to actually propegate the errors to the caller, we need to run the coroutine with 'async' instead of 'launch'.

https://kotlinlang.org/docs/exception-handling.html#exception-propagation

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • We added this recently for fenix which has not started using it yet. This fixes for fenix needs.
  • Quality: This PR builds and tests run cleanly
    • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
    • Consumer is fenix which will receive through nightly process automatically.
  • Tests: This PR includes thorough tests or an explanation of why it does not
    • We don't currently have the ability to force recordEvent failures with current interface.
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • N/A

In order to actually propegate the errors to the caller, we need to run the
coroutine with 'async' instead of 'launch'.
@moztcampbell
Copy link
Collaborator Author

I did manual testing with Fenix by adding a use of this API, and modifying the underlying recordEvent to throw an exception. I was able to confirm that changing 'launch' to 'async' turns exception into a catchable one as desired.

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.

1 participant