【发布时间】:2021-01-04 01:58:48
【问题描述】:
我在云函数中进行了 https 调用,如果条件失败则抛出错误,在颤振中我成功处理了它,它向我显示:PlatformException(functionsError, Cloud function failed with exception., {code: FAILED_PRECONDITION, details: null,消息:错误:您的卡被拒绝。})
但我想知道如何才能让消息部分显示给用户?到目前为止,我已经尝试过 e.message 但这没有用
CloudFunctions(app: Firebase.app(), region: 'asia-southeast2')
.getHttpsCallable(functionName: 'addPayment')
.call({
'paymentMethodId': paymentMethod.id,
'userid': FirebaseAuth.instance.currentUser.uid,
}).catchError((e) => print('ERROR $e'));
这是我的功能
【问题讨论】:
标签: flutter google-cloud-functions