Firebase web client rewrites the error message returned by an https.onRequest function, how to prevent that?

前端 未结 1 1170
野趣味
野趣味 2021-01-26 07:56

I can not retrieve the message I send back from an \"https.onRequest\" function. The firebase client rewrites the message based on the error code and I can not recover the origi

1条回答
  •  醉话见心
    2021-01-26 08:10

    You're mixing up callable and regular HTTP type functions. That's not going to work at all.

    On your function side, you're declaring the function as a regular HTTP type function using the onRequest callback. This means you need to use an HTTP client library to access it.

    On your client side, you're trying to invoke the function as a callable type function using the Functions client SDK. This requires that you declare your function using an onCall callback, not the onRequest callback that you're using now. Callables have a special protocol that's implemented by the client SDK.

    The client and server have to match; right now they do not. If you want to use a callable function, follow all the instructions in the linked documentation. If you want a regular HTTP type function, you can't use Functions client SDK. You have to use some other HTTP client library.

    0 讨论(0)
提交回复
热议问题