Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

fix tensorboard catch error code bug #4029

Merged
merged 1 commit into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions ts/webui/src/components/modals/tensorboard/TensorboardDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,32 @@ function TensorboardDialog(props): any {
onHideDialog();
}

const startTensorboard = isReaptedStartTensorboard ? (
<div>
You had started this tensorBoard with these trials:
<span className='bold'>{item.trialJobIdList.join(', ')}</span>.
<div className='line-height'>
Its tensorBoard id: <span className='bold'>{item.id}</span>
</div>
</div>
) : (
<div>
You are starting a new TensorBoard with trials:
<span className='bold'>{item.trialJobIdList.join(', ')}</span>.
<div className='line-height'>
TensorBoard id: <span className='bold'>{item.id}</span>
</div>
</div>
);

return (
<Dialog hidden={false} dialogContentProps={dialogContentProps} modalProps={{ className: 'dialog' }}>
{errorMessage.error ? (
<div>
<span>Failed to start tensorBoard! Error message: {errorMessage.message}</span>.
<span>Error message: {errorMessage.message}</span>
</div>
) : isShowTensorboardDetail ? (
<div>
This tensorBoard with trials: <span className='bold'>{item.trialJobIdList.join(', ')}</span>.
</div>
) : isReaptedStartTensorboard ? (
<div>
You had started this tensorBoard with these trials:
<span className='bold'>{item.trialJobIdList.join(', ')}</span>.
<div className='line-height'>
Its tensorBoard id: <span className='bold'>{item.id}</span>
</div>
</div>
) : (
startTensorboard
<div>
You are starting a new TensorBoard with trials:
<span className='bold'>{item.trialJobIdList.join(', ')}</span>.
<div className='line-height'>
TensorBoard id: <span className='bold'>{item.id}</span>
</div>
</div>
)}
{errorMessage.error ? (
<DialogFooter>
Expand Down
12 changes: 7 additions & 5 deletions ts/webui/src/components/modals/tensorboard/TensorboardUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ function TensorboardUI(props): any {
setTensorboardPanelVisible(true);
}
})
.catch(error => {
setErrorMessage({
error: true,
message: error.message || 'Tensorboard start failed'
});
.catch(err => {
if (err.response) {
setErrorMessage({
error: true,
message: err.response.data.error || 'Failed to start tensorBoard!'
});
}
setTensorboardPanelVisible(true);
});
setReaptedTensorboard(false);
Expand Down