diff --git a/docs/develop/dialog-handle-errors-events.md b/docs/develop/dialog-handle-errors-events.md index 85d2ada5f..f1a1be4b7 100644 --- a/docs/develop/dialog-handle-errors-events.md +++ b/docs/develop/dialog-handle-errors-events.md @@ -1,7 +1,7 @@ --- title: Handling errors and events in the Office dialog box description: Learn how to trap and handle errors when opening and using the Office dialog box. -ms.date: 05/10/2024 +ms.date: 03/11/2025 ms.topic: error-reference ms.localizationpriority: medium --- @@ -11,13 +11,13 @@ ms.localizationpriority: medium This article describes how to trap and handle errors when opening the dialog box and errors that happen inside the dialog box. > [!NOTE] -> This article presupposes that you are familiar with the basics of using the Office dialog API as described in [Use the Office dialog API in your Office Add-ins](dialog-api-in-office-add-ins.md). +> This article presupposes that you're familiar with the basics of using the Office dialog API as described in [Use the Office dialog API in your Office Add-ins](dialog-api-in-office-add-ins.md). > > See also [Best practices and rules for the Office dialog API](dialog-best-practices.md). Your code should handle two categories of events. -- Errors returned by the call of `displayDialogAsync` because the dialog box cannot be created. +- Errors returned by the call of `displayDialogAsync` because the dialog box can't be created. - Errors, and other events, in the dialog box. ## Errors from displayDialogAsync @@ -26,7 +26,7 @@ In addition to general platform and system errors, four errors are specific to c |Code number|Meaning| |:-----|:-----| -|12004|The domain of the URL passed to `displayDialogAsync` isn't trusted. The domain must be the same domain as the host page (including protocol and port number).| +|12004|The domain of the URL passed to `displayDialogAsync` isn't trusted. The domain must be the same domain as the host page (including protocol and port number).

In Outlook on the web and the [new Outlook on Windows](https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627), this error occurs when an add-in is hosted on a localhost server and its manifest doesn't specify an [AppDomain](/javascript/api/manifest/appdomain) element for localhost.| |12005|The URL passed to `displayDialogAsync` uses the HTTP protocol. HTTPS is required. (In some versions of Office, the error message text returned with 12005 is the same one returned for 12004.)| |12007|A dialog box is already opened from this host window. A host window, such as a task pane, can only have one dialog box open at a time.| |12009|The user chose to ignore the dialog box. This error can occur in Office on the web, where users may choose not to allow an add-in to present a dialog box. For more information, see [Handling pop-up blockers with Office on the web](dialog-best-practices.md#handle-pop-up-blockers-with-office-on-the-web).| @@ -53,7 +53,7 @@ Three errors and events in the dialog box will raise a `DialogEventReceived` eve |Code number|Meaning| |:-----|:-----| -|12002|One of the following:| +|12002|One of the following:| |12003|The dialog box was directed to a URL with the HTTP protocol. HTTPS is required.| |12006|One of the following:| @@ -75,7 +75,7 @@ For an example of a handler for the `DialogEventReceived` event that creates cus function processDialogEvent(arg) { switch (arg.error) { case 12002: - showNotification("The dialog box has been directed to a page that it cannot find or load, or the URL syntax is invalid."); + showNotification("The dialog box has been directed to a page that it can't find or load, or the URL syntax is invalid."); break; case 12003: showNotification("The dialog box has been directed to a URL with the HTTP protocol. HTTPS is required."); break;