из документации в здесь
Я могу выдать ошибку, используя синтаксис, подобный этому
throw new functions.https.HttpsError('failed-precondition', 'The function must be called ' +
'while authenticated.');
и в Android устройстве
private fun addMessage(text: String): Task<String> {
// Create the arguments to the callable function.
val data = hashMapOf(
"text" to text,
"push" to true
)
return functions
.getHttpsCallable("addMessage")
.call(data)
.continueWith { task ->
// This continuation runs on either success or failure, but if the task
// has failed then result will throw an Exception which will be
// propagated down.
val result = task.result?.data as String
result
}
}
addMessage(inputMessage)
.addOnCompleteListener(OnCompleteListener { task ->
if (!task.isSuccessful) {
val e = task.exception
if (e is FirebaseFunctionsException) {
val code = e.code
val details = e.details
}
// ...
}
// ...
})
как мне получить сообщение об ошибке, которое выдается из облачной функции? Я хочу показать сообщение об ошибке из облачной функции, используя toast
Функция должна вызываться '+' во время аутентификации.
синтаксис в Android странный. в деталях? но детализация any