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

https_fn.HttpsError::message isn't really surfaced #1137

Open
elbee19 opened this issue Jun 2, 2024 · 0 comments
Open

https_fn.HttpsError::message isn't really surfaced #1137

elbee19 opened this issue Jun 2, 2024 · 0 comments

Comments

@elbee19
Copy link

elbee19 commented Jun 2, 2024

message=('The function must be called with one argument, "text",'

I'm testing a 2nd gen python firebase function defined that looks something like the following:

@https_fn.on_call(
    cors=options.CorsOptions(
        cors_origins=["xxx"],
        cors_methods=["get", "post"],
    )
)
def new_gift(req: https_fn.Request) -> https_fn.Response:
    logger.info("Request Headers:", dict(req.headers))

    if req.authorization is None:
        # Throwing an HttpsError so that the client gets the error details.
        raise https_fn.HttpsError(
            code=https_fn.FunctionsErrorCode.FAILED_PRECONDITION,
            message="This never shows up anywhere!"
        )

During my local testing (over the emulator) the 'message' string isn't really surfaced anywhere - neither to the client when the call to the function is made, nor over the local emulator logs (I'm not sure if the behavior differs over the cloud deployment - yet to test that)

This can't be by design right? Cause what'd be the point of the message string in that case?

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