Skip to content

Commit cd55137

Browse files
authored
Merge pull request #14485 from HuihuiWu-Microsoft/add-help-link-da
fix: add help link when user meet error for uploading da package
2 parents 8421055 + d8abd39 commit cd55137

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

packages/fx-core/src/component/m365/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ export const outlookCopilotAppId = "d870f6cd-4aa5-4d42-9626-ab690c041429";
1111
export const outlookBaseUrl = "https://outlook.office.com";
1212
export const officeBaseUrl = "https://www.office.com";
1313
export const advancedDASettingUrl = "https://aka.ms/atk-actions/teamsapp-extendToM365";
14+
export const M365HelpLink = "https://aka.ms/teamsfx-actions/teamsapp-extendToM365";

packages/fx-core/src/component/m365/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import { UserError } from "@microsoft/teamsfx-api";
55

66
import { getDefaultString, getLocalizedString } from "../../common/localizeUtils";
7+
import { M365HelpLink } from "./constants";
78

89
export class NotExtendedToM365Error extends UserError {
910
constructor(source: string) {
@@ -12,7 +13,7 @@ export class NotExtendedToM365Error extends UserError {
1213
name: "NotExtendedToM365Error",
1314
message: getDefaultString("error.m365.NotExtendedToM365Error"),
1415
displayMessage: getLocalizedString("error.m365.NotExtendedToM365Error"),
15-
helpLink: "https://aka.ms/teamsfx-actions/teamsapp-extendToM365",
16+
helpLink: M365HelpLink,
1617
});
1718
}
1819
}

packages/fx-core/src/component/m365/packageService.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { NotExtendedToM365Error } from "./errors";
3535
import { M365AppDefinition, M365AppEntity } from "./interface";
3636
import { MosServiceEndpoint } from "./serviceConstant";
3737
import { getDefaultString, getLocalizedString } from "../../common/localizeUtils";
38-
import { advancedDASettingUrl } from "./constants";
38+
import { advancedDASettingUrl, M365HelpLink } from "./constants";
3939

4040
const M365ErrorSource = "M365";
4141
const M365ErrorComponent = "PackageService";
@@ -257,7 +257,11 @@ export class PackageService {
257257
if (error.response) {
258258
error = this.traceError(error);
259259
}
260-
throw assembleError(error, M365ErrorSource);
260+
const err = assembleError(error, M365ErrorSource);
261+
if (err instanceof UserError) {
262+
err.helpLink = M365HelpLink;
263+
}
264+
throw err;
261265
}
262266
}
263267

0 commit comments

Comments
 (0)