-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
There was a problem hiding this 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
Lines 22 to 26 in 12c6294
export class CapacitorException extends Error { | |
constructor(readonly message: string, readonly code?: ExceptionCode) { | |
super(message); | |
} | |
} |
There was a problem hiding this 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?
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