chore: show innermost error in ui mode (#26840)
This commit is contained in:
parent
a339bead09
commit
1c5f53f216
|
|
@ -96,4 +96,5 @@
|
|||
|
||||
.call-tab .error-message {
|
||||
padding: 5px;
|
||||
line-height: 17px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,11 @@ export class MultiTraceModel {
|
|||
this.resources.sort((a1, a2) => a1._monotonicTime! - a2._monotonicTime!);
|
||||
this.sources = collectSources(this.actions);
|
||||
}
|
||||
|
||||
failedAction() {
|
||||
// This find innermost action for nested ones.
|
||||
return this.actions.findLast(a => a.error);
|
||||
}
|
||||
}
|
||||
|
||||
function indexModel(context: ContextEntry) {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export const Workbench: React.FunctionComponent<{
|
|||
React.useEffect(() => {
|
||||
if (selectedAction && model?.actions.includes(selectedAction))
|
||||
return;
|
||||
const failedAction = model?.actions.find(a => a.error);
|
||||
const failedAction = model?.failedAction();
|
||||
if (initialSelection && model?.actions.includes(initialSelection))
|
||||
setSelectedAction(initialSelection);
|
||||
else if (failedAction)
|
||||
|
|
|
|||
Loading…
Reference in a new issue