Skip to content

Commit 527ac24

Browse files
authored
Merge pull request #1151 from c-bata/improve-error-handling-trial-list
Suppress `console.error()` when clicking Deny button on TrialList
2 parents bea61b0 + e8a0e09 commit 527ac24

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

optuna_dashboard/ts/components/TrialList.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ const useTrials = (
123123
.then((filtered) => {
124124
setFilteredTrials(filtered)
125125
})
126-
.catch((error) => {
127-
console.error("Failed to filter trials:", error)
126+
.catch(() => {
128127
setFilteredTrials(result) // Fallback to unfiltered trials on error
129128
})
130129
} else {
@@ -474,7 +473,10 @@ export const TrialList: FC<{ studyDetail: StudyDetail | null }> = ({
474473
useTrialFilterQuery({
475474
nRetry: 5,
476475
onDenied: handleClearFilter,
477-
onFailed: handleClearFilter,
476+
onFailed: (errorMsg: string) => {
477+
console.error("Failed to filter trials:", errorMsg)
478+
handleClearFilter()
479+
},
478480
})
479481
const llmEnabled = useAtomValue(llmIsAvailable)
480482
const trials = useTrials(

0 commit comments

Comments
 (0)