Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly propagate exception to swift #23

Open
corrado4eyes opened this issue Jul 3, 2023 · 1 comment
Open

Correctly propagate exception to swift #23

corrado4eyes opened this issue Jul 3, 2023 · 1 comment

Comments

@corrado4eyes
Copy link
Collaborator

Right now the Exception thrown by Cucumberish on kotlin/native is not being propagated to swift, causing the program to be terminated by the system, hence error log will be incomplete for the failing test and if a TestPlan sets that a screenshot should be made, that won't happen.

@corrado4eyes
Copy link
Collaborator Author

When Cucumberish is used from K/N a kotlin native bridge is created by passing a lambda to a definition method from Cucumberish (Then, When, Given etc..). That cause the exception thrown inside the lambda by the failed assertion to not be propagated to the test runner where it is trying to catch that CCIException, but instead terminate the programs when that happens.
For now I'm putting aside moving the Cucumber definitions on shared code since also in that case the developer had to declare them twice (on Android and iOS).

To overcome this issue we could take different paths:

  • Fork and update Cucumberish so that throws an NSError that is propagated correctly to K/N.
  • Understand and make ForeignException feature work, catch it and return a result type to the call site on swift that throws an NSError.

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

No branches or pull requests

1 participant