core-plugin-api: added ErrorApi* prefix to Error and ErrorContext types
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/core-plugin-api': patch
|
||||
---
|
||||
|
||||
Deprecated the `Error` and `ErrorContext` types, replacing them with identical `ErrorApiError` and `ErrorApiErrorContext` types.
|
||||
@@ -28,8 +28,9 @@ import { bitbucketAuthApiRef } from '@backstage/core-plugin-api';
|
||||
import { ComponentType } from 'react';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { DiscoveryApi } from '@backstage/core-plugin-api';
|
||||
import { Error as Error_2 } from '@backstage/core-plugin-api';
|
||||
import { ErrorApi } from '@backstage/core-plugin-api';
|
||||
import { ErrorApiError } from '@backstage/core-plugin-api';
|
||||
import { ErrorApiErrorContext } from '@backstage/core-plugin-api';
|
||||
import { ErrorContext } from '@backstage/core-plugin-api';
|
||||
import { ExternalRouteRef } from '@backstage/core-plugin-api';
|
||||
import { FeatureFlag } from '@backstage/core-plugin-api';
|
||||
@@ -327,8 +328,8 @@ export class ErrorAlerter implements ErrorApi {
|
||||
constructor(alertApi: AlertApi, errorApi: ErrorApi);
|
||||
// (undocumented)
|
||||
error$(): Observable<{
|
||||
error: Error_2;
|
||||
context?: ErrorContext | undefined;
|
||||
error: ErrorApiError;
|
||||
context?: ErrorApiErrorContext | undefined;
|
||||
}>;
|
||||
// (undocumented)
|
||||
post(error: Error, context?: ErrorContext): void;
|
||||
|
||||
@@ -404,23 +404,31 @@ export interface ElementCollection {
|
||||
}): ElementCollection;
|
||||
}
|
||||
|
||||
// @public
|
||||
type Error_2 = {
|
||||
name: string;
|
||||
message: string;
|
||||
stack?: string;
|
||||
};
|
||||
// @public @deprecated (undocumented)
|
||||
type Error_2 = ErrorApiError;
|
||||
export { Error_2 as Error };
|
||||
|
||||
// @public
|
||||
export type ErrorApi = {
|
||||
post(error: Error_2, context?: ErrorContext): void;
|
||||
post(error: ErrorApiError, context?: ErrorApiErrorContext): void;
|
||||
error$(): Observable_2<{
|
||||
error: Error_2;
|
||||
context?: ErrorContext;
|
||||
error: ErrorApiError;
|
||||
context?: ErrorApiErrorContext;
|
||||
}>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type ErrorApiError = {
|
||||
name: string;
|
||||
message: string;
|
||||
stack?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type ErrorApiErrorContext = {
|
||||
hidden?: boolean;
|
||||
};
|
||||
|
||||
// @public
|
||||
export const errorApiRef: ApiRef<ErrorApi>;
|
||||
|
||||
@@ -431,10 +439,8 @@ export type ErrorBoundaryFallbackProps = {
|
||||
resetError: () => void;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type ErrorContext = {
|
||||
hidden?: boolean;
|
||||
};
|
||||
// @public @deprecated (undocumented)
|
||||
export type ErrorContext = ErrorApiErrorContext;
|
||||
|
||||
// @public
|
||||
export type Extension<T> = {
|
||||
|
||||
@@ -23,22 +23,34 @@ import { Observable } from '@backstage/types';
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type Error = {
|
||||
export type ErrorApiError = {
|
||||
name: string;
|
||||
message: string;
|
||||
stack?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use ErrorApiError instead
|
||||
*/
|
||||
export type Error = ErrorApiError;
|
||||
|
||||
/**
|
||||
* Provides additional information about an error that was posted to the application.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type ErrorContext = {
|
||||
export type ErrorApiErrorContext = {
|
||||
// If set to true, this error should not be displayed to the user. Defaults to false.
|
||||
hidden?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use ErrorApiErrorContext instead
|
||||
*/
|
||||
export type ErrorContext = ErrorApiErrorContext;
|
||||
|
||||
/**
|
||||
* The error API is used to report errors to the app, and display them to the user.
|
||||
*
|
||||
@@ -62,12 +74,15 @@ export type ErrorApi = {
|
||||
/**
|
||||
* Post an error for handling by the application.
|
||||
*/
|
||||
post(error: Error, context?: ErrorContext): void;
|
||||
post(error: ErrorApiError, context?: ErrorApiErrorContext): void;
|
||||
|
||||
/**
|
||||
* Observe errors posted by other parts of the application.
|
||||
*/
|
||||
error$(): Observable<{ error: Error; context?: ErrorContext }>;
|
||||
error$(): Observable<{
|
||||
error: ErrorApiError;
|
||||
context?: ErrorApiErrorContext;
|
||||
}>;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user