【问题描述】
开发者希望在云函数代码中调用别的云函数,于是参考官方文档,编写Node.js的函数代码,导入到AGC控制台进行测试,返回结果总是会报下面这个错误。
{ "code": 180000, "message": "Call handler error: 10602: agc client name already exist" }
开发者的函数代码如下:
const agconnect = require('@agconnect/common-server');
const { AGCFunction } = require("@hw-agconnect/function-server");
let path = require('path');
let api_client_path = path.join(__dirname, "agc-apiclient.json");
const agcClient = agconnect.AGCClient.getInstance();
agconnect.AGCClient.initialize(agconnect.CredentialParser.toCredential(api_client_path));
var agcFunction = new AGCFunction(agcClient);
let myHandler = function(event, context, callback, logger) {
let callable= agcFunction.wrap("gettman","$latest");
let result=callable.call()
//send response
callback({&