Skip to content

Commit c215626

Browse files
committed
fix apigateway "RepeatedPathError: The specified path conflict with the API" bug
1 parent 5b08a6a commit c215626

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

lib/deploy/deploy-support.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ async function makeService({serviceName,
235235
try {
236236
service = await fc.getService(serviceName);
237237
} catch (ex) {
238-
if (ex.code !== 'ServiceNotFound') {
238+
if (ex.code === 'AccessDenied') {
239+
throw ex;
240+
} else if (ex.code !== 'ServiceNotFound') {
239241
console.log(red(`\tretry ${times} times`));
240242
retry(ex);
241243
}
@@ -596,8 +598,13 @@ async function makeApi(group, {
596598
ApiName: apiName,
597599
GroupId: group.GroupId
598600
});
599-
600-
var api = result.ApiSummarys && result.ApiSummarys.ApiSummary[0];
601+
602+
var apiSummarys = result.ApiSummarys && result.ApiSummarys.ApiSummary;
603+
var api;
604+
605+
if (apiSummarys) {
606+
api = apiSummarys.find(summary => summary.ApiName === apiName);
607+
}
601608

602609
const requestParameters = parameters.map((item) => {
603610
return Object.assign(getDefaultRequestParameter(), item);

0 commit comments

Comments
 (0)