Makes plugin optional in ErrorBoundaryFallback
Signed-off-by: Juan Lulkin <jmaiz@spotify.com>
This commit is contained in:
committed by
Fredrik Adelöw
parent
75b8537ce1
commit
467fe2200c
@@ -61,7 +61,7 @@ export type AppComponents = {
|
||||
Router: ComponentType<{}>;
|
||||
ErrorBoundaryFallback: ComponentType<
|
||||
ErrorBoundaryFallbackProps & {
|
||||
plugin: BackstagePlugin;
|
||||
plugin?: BackstagePlugin;
|
||||
}
|
||||
>;
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ describe('extensions', () => {
|
||||
const apis = ApiRegistry.from([[errorApiRef, errorApi]]);
|
||||
|
||||
const MockFallback: AppComponents['ErrorBoundaryFallback'] = props => (
|
||||
<>Error in {props.plugin.getId()}</>
|
||||
<>Error in {props.plugin?.getId()}</>
|
||||
);
|
||||
|
||||
const { error: errors } = await withLogCollector(['error'], async () => {
|
||||
|
||||
@@ -28,7 +28,7 @@ export const ErrorBoundaryFallback: AppComponents['ErrorBoundaryFallback'] = ({
|
||||
}) => {
|
||||
return (
|
||||
<ResponseErrorPanel
|
||||
title={`Error in ${plugin.getId()}`}
|
||||
title={`Error in ${plugin?.getId()}`}
|
||||
defaultExpanded
|
||||
error={error}
|
||||
actions={
|
||||
|
||||
Reference in New Issue
Block a user