-
Notifications
You must be signed in to change notification settings - Fork 625
Ignore empty message string in FirebaseFunctionsException #501
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
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
Hi @muZk. Thanks for your PR. I'm waiting for a firebase member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
/ok-to-test |
Looks good to me. Thanks for the fix! I was considering whether it might be better to do error.opt("message", null), but no, I think this PR is better, because an explicit empty string wouldn't work anyway. Looks like the line might be too long. Make sure to run |
Yes, that's the command! I just ran it without modifications. Maybe it is ok? (93 char long) |
@muZk thanks! Gonna merge this now. |
When throwing
new HttpsError('not-found')
in a cloud function (ie: without specifyingmessage
parameter),error.opt("message")
will be just an empty string, so:error.opt("message") instanceof String
istrue
details
will be assigned to""
.new FirebaseFunctionsException(description, code, details)
will be called with this empty stringDetail message must not be empty
exception.With this change,
details
will be equal to whatevercode.name()
returns when the cloud function sends an empty string as a message. In the case ofHttpsError('not-found')
, it will beNOT_FOUND
.