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

feat(android): Add Optional Data Param for Error Object #5719

Merged
merged 9 commits into from
Jul 21, 2022

Conversation

ItsChaceD
Copy link
Contributor

@ItsChaceD ItsChaceD commented Jun 24, 2022

This PR adds an optional data object to be passed to call.reject() in order to be consistent with the method signatures on iOS.

closes #5336

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

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

The types should be updated to include the optional data

export class CapacitorException extends Error {
constructor(readonly message: string, readonly code?: ExceptionCode) {
super(message);
}
}

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

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

I've been testing on both iOS and Android and they behave differently, on iOS every property of the returned dictionary is added to the error object directly instead of all of them being an object inside the "data" property.
I kind of like the android behaviour best and also it's how types say a CapacitorException should look like, so can you also change iOS to work like Android?

@jcesarmobile jcesarmobile changed the title fix(android): Adds Optional Data Param for Error Object feat(android): Add Optional Data Param for Error Object Jul 20, 2022
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.

bug: On android the signature of the reject method is different than on ios
3 participants