forked from deephaven/deephaven-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display the full stack trace for errors in a panel
- TODO: Fix the Reload button. Doesn't quite seem to be working.
- Loading branch information
Showing
7 changed files
with
153 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import { Button } from '@deephaven/components'; | ||
import ErrorView from './ErrorView'; | ||
import { WidgetError } from './WidgetTypes'; | ||
|
||
/** Component that takes a WidgetError and displays the contents in an ErrorView, and has a button to reload the widget from a fresh state. */ | ||
function WidgetErrorView({ | ||
error, | ||
onReload, | ||
}: { | ||
error: WidgetError; | ||
onReload: () => void; | ||
}): JSX.Element { | ||
const displayMessage = `${error.message}\n\n${error.stack}`.trim(); | ||
return ( | ||
<div className="widget-error-view"> | ||
<ErrorView message={displayMessage} type={error.type} /> | ||
<div className="widget-error-view-footer"> | ||
<Button kind="tertiary" onClick={onReload}> | ||
Reload | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default WidgetErrorView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters