Unverified Commit a15eeab6 authored by Lijiaoa's avatar Lijiaoa Committed by GitHub
Browse files

fix tensorboard catch error code bg (#4029)

parent 5a71fa42
......@@ -17,7 +17,17 @@ function TensorboardDialog(props): any {
onHideDialog();
}
const startTensorboard = isReaptedStartTensorboard ? (
return (
<Dialog hidden={false} dialogContentProps={dialogContentProps} modalProps={{ className: 'dialog' }}>
{errorMessage.error ? (
<div>
<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>.
......@@ -33,20 +43,6 @@ function TensorboardDialog(props): any {
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>.
</div>
) : isShowTensorboardDetail ? (
<div>
This tensorBoard with trials: <span className='bold'>{item.trialJobIdList.join(', ')}</span>.
</div>
) : (
startTensorboard
)}
{errorMessage.error ? (
<DialogFooter>
......
......@@ -41,11 +41,13 @@ function TensorboardUI(props): any {
setTensorboardPanelVisible(true);
}
})
.catch(error => {
.catch(err => {
if (err.response) {
setErrorMessage({
error: true,
message: error.message || 'Tensorboard start failed'
message: err.response.data.error || 'Failed to start tensorBoard!'
});
}
setTensorboardPanelVisible(true);
});
setReaptedTensorboard(false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment