[office-js] [office-js-preview] (Outlook) Link to error object (#37407)

* [Outlook] (diagnostics) Link to error object

* List applicable errors for token APIs

* Update spacing
This commit is contained in:
Elizabeth Samuel
2019-08-07 14:23:58 -07:00
committed by Nathan Shively-Sanders
parent b6eb44512b
commit e7228714b0
2 changed files with 66 additions and 8 deletions
+33 -4
View File
@@ -437,10 +437,12 @@ declare namespace Office {
*/
asyncContext: any;
/**
* Gets an object that may provide additional information if an error occurred.
* Gets an object that may provide additional information if an {@link Office.Error | error} occurred.
*
* @remarks
*
* This property returns additional information if the following errors occur with these supported APIs.
*
* *Supported APIs*
*
* `Office.context.mailbox.item.getCallbackTokenAsync`, `Office.context.mailbox.item.getUserIdentityTokenAsync`
@@ -15366,12 +15368,21 @@ declare namespace Office {
*
* **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read
*
* **Errors**:
*
* - HTTPRequestFailure: The request has failed. Please look at the diagnostics object for the HTTP error code.
*
* - InternalServerError: The Exchange server returned an error. Please look at the diagnostics object for more information.
*
* - NetworkError: The user is no longer connected to the network. Please check your network connection and try again.
*
* @param options - An object literal that contains one or more of the following properties.
* isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false.
* asyncContext: Any state data that is passed to the asynchronous method.
* @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of
* type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property.
* If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information.
* If there was an error, the `error` and `diagnostics` properties of the {@link Office.AsyncResult | `asyncResult`} object
* may provide additional information.
*/
getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (asyncResult: Office.AsyncResult<string>) => void): void;
/**
@@ -15393,13 +15404,22 @@ declare namespace Office {
*
* @remarks
*
* **Errors**:
*
* - HTTPRequestFailure: The request has failed. Please look at the diagnostics object for the HTTP error code.
*
* - InternalServerError: The Exchange server returned an error. Please look at the diagnostics object for more information.
*
* - NetworkError: The user is no longer connected to the network. Please check your network connection and try again.
*
* **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem
*
* **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read
*
* @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of
* type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property.
* If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information.
* If there was an error, the `error` and `diagnostics` properties of the {@link Office.AsyncResult | `asyncResult`} object
* may provide additional information.
* @param userContext - Optional. Any state data that is passed to the asynchronous method.
*/
getCallbackTokenAsync(callback: (asyncResult: Office.AsyncResult<string>) => void, userContext?: any): void;
@@ -15419,10 +15439,19 @@ declare namespace Office {
* The getUserIdentityTokenAsync method returns a token that you can use to identify and
* {@link https://docs.microsoft.com/outlook/add-ins/authentication | authenticate the add-in and user with a third-party system}.
*
* **Errors**:
*
* - HTTPRequestFailure: The request has failed. Please look at the diagnostics object for the HTTP error code.
*
* - InternalServerError: The Exchange server returned an error. Please look at the diagnostics object for more information.
*
* - NetworkError: The user is no longer connected to the network. Please check your network connection and try again.
*
* @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of
* type Office.AsyncResult.
* The token is provided as a string in the `asyncResult.value` property.
* If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information.
* If there was an error, the `error` and `diagnostics` properties of the {@link Office.AsyncResult | `asyncResult`} object
* may provide additional information.
* @param userContext - Optional. Any state data that is passed to the asynchronous method.
*/
getUserIdentityTokenAsync(callback: (asyncResult: Office.AsyncResult<string>) => void, userContext?: any): void;
+33 -4
View File
@@ -437,10 +437,12 @@ declare namespace Office {
*/
asyncContext: any;
/**
* Gets an object that may provide additional information if an error occurred.
* Gets an object that may provide additional information if an {@link Office.Error | error} occurred.
*
* @remarks
*
* This property returns additional information if the following errors occur with these supported APIs.
*
* *Supported APIs*
*
* `Office.context.mailbox.item.getCallbackTokenAsync`, `Office.context.mailbox.item.getUserIdentityTokenAsync`
@@ -13623,12 +13625,21 @@ declare namespace Office {
*
* **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read
*
* **Errors**:
*
* - HTTPRequestFailure: The request has failed. Please look at the diagnostics object for the HTTP error code.
*
* - InternalServerError: The Exchange server returned an error. Please look at the diagnostics object for more information.
*
* - NetworkError: The user is no longer connected to the network. Please check your network connection and try again.
*
* @param options - An object literal that contains one or more of the following properties.
* isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false.
* asyncContext: Any state data that is passed to the asynchronous method.
* @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of
* type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property.
* If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information.
* If there was an error, the `error` and `diagnostics` properties of the {@link Office.AsyncResult | `asyncResult`} object
* may provide additional information.
*/
getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (asyncResult: Office.AsyncResult<string>) => void): void;
/**
@@ -13654,9 +13665,18 @@ declare namespace Office {
*
* **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read
*
* **Errors**:
*
* - HTTPRequestFailure: The request has failed. Please look at the diagnostics object for the HTTP error code.
*
* - InternalServerError: The Exchange server returned an error. Please look at the diagnostics object for more information.
*
* - NetworkError: The user is no longer connected to the network. Please check your network connection and try again.
*
* @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of
* type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property.
* If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information.
* If there was an error, the `error` and `diagnostics` properties of the {@link Office.AsyncResult | `asyncResult`} object
* may provide additional information.
* @param userContext - Optional. Any state data that is passed to the asynchronous method.
*/
getCallbackTokenAsync(callback: (asyncResult: Office.AsyncResult<string>) => void, userContext?: any): void;
@@ -13676,10 +13696,19 @@ declare namespace Office {
* The getUserIdentityTokenAsync method returns a token that you can use to identify and
* {@link https://docs.microsoft.com/outlook/add-ins/authentication | authenticate the add-in and user with a third-party system}.
*
* **Errors**:
*
* - HTTPRequestFailure: The request has failed. Please look at the diagnostics object for the HTTP error code.
*
* - InternalServerError: The Exchange server returned an error. Please look at the diagnostics object for more information.
*
* - NetworkError: The user is no longer connected to the network. Please check your network connection and try again.
*
* @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of
* type Office.AsyncResult.
* The token is provided as a string in the `asyncResult.value` property.
* If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information.
* If there was an error, the `error` and `diagnostics` properties of the {@link Office.AsyncResult | `asyncResult`} object
* may provide additional information.
* @param userContext - Optional. Any state data that is passed to the asynchronous method.
*/
getUserIdentityTokenAsync(callback: (asyncResult: Office.AsyncResult<string>) => void, userContext?: any): void;