MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / ToolErrorView

Function ToolErrorView

web/pgadmin/static/js/ToolErrorView.jsx:18–31  ·  view source on GitHub ↗
({error, panelId, panelDocker})

Source from the content-addressed store, hash-verified

16}));
17
18export default function ToolErrorView({error, panelId, panelDocker}){
19 const { deleteToolData } = useApplicationState();
20 panelDocker.eventBus.registerListener(LAYOUT_EVENTS.CLOSING, (id)=>{
21 if(panelId == id) {
22 panelDocker.close(panelId, true);
23 deleteToolData(panelId);
24 }
25 });
26
27 let err_msg = gettext('An error occurred while opening the tool: %s', error ?? '');
28 return (<StyledBox>
29 <FormHelperText variant="outlined" error={true} style={{marginLeft: '4px'}}><SafeMessage text={err_msg} /></FormHelperText>
30 </StyledBox>);
31}
32
33ToolErrorView.propTypes = {
34 error: PropTypes.string,

Callers

nothing calls this directly

Calls 5

useApplicationStateFunction · 0.90
deleteToolDataFunction · 0.85
gettextFunction · 0.85
registerListenerMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected