From 8eedc159ae5c96cbb8b23a792e4dbe1a08c12250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 26 Oct 2021 16:55:36 +0200 Subject: [PATCH] fix up errors too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/lazy-dodos-drum.md | 1 + packages/errors/api-report.md | 1 - packages/errors/src/errors/CustomErrorBase.ts | 3 +++ packages/integration/api-report.md | 6 ------ packages/integration/src/registry.ts | 13 +++++++++---- packages/integration/src/types.ts | 13 +++++++++---- 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.changeset/lazy-dodos-drum.md b/.changeset/lazy-dodos-drum.md index 81852ac7e5..b4d72aca28 100644 --- a/.changeset/lazy-dodos-drum.md +++ b/.changeset/lazy-dodos-drum.md @@ -1,4 +1,5 @@ --- +'@backstage/errors': patch '@backstage/integration': patch '@backstage/theme': patch --- diff --git a/packages/errors/api-report.md b/packages/errors/api-report.md index a96132cee7..4984919e6a 100644 --- a/packages/errors/api-report.md +++ b/packages/errors/api-report.md @@ -17,7 +17,6 @@ export class ConflictError extends CustomErrorBase {} // @public export class CustomErrorBase extends Error { constructor(message?: string, cause?: Error | unknown); - // (undocumented) readonly cause?: Error | undefined; } diff --git a/packages/errors/src/errors/CustomErrorBase.ts b/packages/errors/src/errors/CustomErrorBase.ts index 17149cd398..786e10ef23 100644 --- a/packages/errors/src/errors/CustomErrorBase.ts +++ b/packages/errors/src/errors/CustomErrorBase.ts @@ -33,6 +33,9 @@ import { isError } from './assertion'; * ``` */ export class CustomErrorBase extends Error { + /** + * An inner error that caused this error to be thrown, if any. + */ readonly cause?: Error | undefined; constructor(message?: string, cause?: Error | unknown) { diff --git a/packages/integration/api-report.md b/packages/integration/api-report.md index 48a00e633a..4c2258779a 100644 --- a/packages/integration/api-report.md +++ b/packages/integration/api-report.md @@ -344,9 +344,6 @@ export function replaceGitHubUrlType( // @public export interface ScmIntegration { resolveEditUrl(url: string): string; - // Warning: (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters - // Warning: (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters - // Warning: (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters resolveUrl(options: { url: string; base: string; @@ -370,9 +367,6 @@ export interface ScmIntegrationRegistry // (undocumented) gitlab: ScmIntegrationsGroup; resolveEditUrl(url: string): string; - // Warning: (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters - // Warning: (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters - // Warning: (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters resolveUrl(options: { url: string; base: string; diff --git a/packages/integration/src/registry.ts b/packages/integration/src/registry.ts index 038594d259..5864695e25 100644 --- a/packages/integration/src/registry.ts +++ b/packages/integration/src/registry.ts @@ -45,14 +45,19 @@ export interface ScmIntegrationRegistry * within the file tree of a certain repo, an absolute path of `/b.yaml` does * not resolve to `https://hostname/b.yaml` but rather to * `/b.yaml` inside the file tree of that same repo. - * - * @param options.url - The (absolute or relative) URL or path to resolve - * @param options.base - The base URL onto which this resolution happens - * @param options.lineNumber - The line number in the target file to link to, starting with 1. Only applicable when linking to files. */ resolveUrl(options: { + /** + * The (absolute or relative) URL or path to resolve. + */ url: string; + /** + * The base URL onto which this resolution happens + */ base: string; + /** + * The line number in the target file to link to, starting with 1. Only applicable when linking to files. + */ lineNumber?: number; }): string; diff --git a/packages/integration/src/types.ts b/packages/integration/src/types.ts index 5b17edfb3d..cb4b78eb7c 100644 --- a/packages/integration/src/types.ts +++ b/packages/integration/src/types.ts @@ -44,14 +44,19 @@ export interface ScmIntegration { * within the file tree of a certain repo, an absolute path of `/b.yaml` does * not resolve to `https://hostname/b.yaml` but rather to * `/b.yaml` inside the file tree of that same repo. - * - * @param options.url - The (absolute or relative) URL or path to resolve - * @param options.base - The base URL onto which this resolution happens - * @param options.lineNumber - The line number in the target file to link to, starting with 1. Only applicable when linking to files. */ resolveUrl(options: { + /** + * The (absolute or relative) URL or path to resolve + */ url: string; + /** + * The base URL onto which this resolution happens + */ base: string; + /** + * The line number in the target file to link to, starting with 1. Only applicable when linking to files. + */ lineNumber?: number; }): string;