Skip to content

[admin] Convert @throws to normal description text #391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/docs-ref-autogen/officescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ functions:
necessarily indicate that the API failed. The workbook copy may still be
created, but after the timeout limit this API does not return a success or
failure message.


**Throws**: `ExternalAPITimeout` The error thrown if the API reaches
the timeout limit of 30 seconds. Note that the copy may still be created.


**Throws**: `InvalidExtensionError` The error thrown if the file name
doesn't end with ".xlsx".


**Throws**: `SaveCopyAsFileMayAlreadyExistError` The error thrown if
the file name of the copy already exists.


**Throws**: `SaveCopyAsFileNotOnOneDriveError` The error thrown if the
document is not saved to OneDrive.
remarks: ''

isPreview: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ export declare namespace OfficeScript {
* Saves a copy of the current workbook in OneDrive, in the same directory as the original file, with the specified file name.
* The API has a timeout limit of 30 seconds. This limit is rarely exceeded.
* Note: Timeout doesn't necessarily indicate that the API failed. The workbook copy may still be created, but after the timeout limit this API does not return a success or failure message.
* @throws ExternalApiTimeout The error thrown if the API reaches the timeout limit of 30 seconds. Note that the copy may still be created.
* @throws InvalidExtensionError The error thrown if the file name doesn't end with ".xlsx".
* @throws SaveCopyAsFileMayAlreadyExistError The error thrown if the file name of the copy already exists.
* @throws SaveCopyAsFileNotOnOneDriveError The error thrown if the document is not saved to OneDrive.

* **Throws**: `ExternalApiTimeout` The error thrown if the API reaches the timeout limit of 30 seconds. Note that the copy may still be created.

* **Throws**: `InvalidExtensionError` The error thrown if the file name doesn't end with ".xlsx".

* **Throws**: `SaveCopyAsFileMayAlreadyExistError` The error thrown if the file name of the copy already exists.

* **Throws**: `SaveCopyAsFileNotOnOneDriveError` The error thrown if the document is not saved to OneDrive.
* @param filename - The file name of the copied and saved file. The file name must end with ".xlsx".
* @beta
*/
Expand Down
4 changes: 2 additions & 2 deletions generate-docs/scripts/preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ function applyRegularExpressions (definitionsIn) {
.replace(/^(\s*)(interface)(\s+)/gm, `$1export $2$3`)
.replace(/^(\s*)(module)(\s+)/gm, `$1export $2$3`)
.replace(/^(\s*)(function)(\s+)/gm, `$1export $2$3`)
.replace(/(\s*)(@param)(\s+)(\w+)(\s)(\s)/g, `$1$2$3$4$5`)
.replace(/(\s*)(@param)(\s+)(\w+)(\s+)([^\-])/g, `$1$2$3$4$5- $6`);
.replace(/(\s*)(@param)(\s+)(\w+)(\s+)([^\-])/g, `$1$2$3$4$5- $6`)
.replace(/(\s*)\*(\s*)(@throws)(\s+)(\w+)(.*)/g, `$1$1*$2**Throws**: $4\`$5\`$6`);
}

function readySnippets(snippetsSourceFile: string, snippetDestinationFile: string) {
Expand Down