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

[Functions] Fix iOS exception message #297

Merged
merged 1 commit into from
Jun 12, 2022

Conversation

walkingbrad
Copy link
Contributor

@walkingbrad walkingbrad commented May 2, 2022

When an error is returned in a cloud function (e.g. HttpsError("internal", "This is the error message")), the actual iOS implementation incorrectly propagates the message to FirebaseFunctionsException.

Rather than set message = message, it sets message = theNSError.toString() which produces an Objective-C string representation of the error. This prevents us from being able to parse that field reliably, since it is in an unstructured format and is inconsistent between Android and iOS.

This change brings iOS in parity with Android, where the exception's message matches that of the error returned by Firebase.
e.g. message = "This is the error message"

@nbransby
Copy link
Member

@walkingbrad thanks for the clear description of the issue!

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.

2 participants