Skip to content

Commit 74bb5e3

Browse files
committed
feat: 拆分profiling插件应用和服务
# Reviewed, transaction id: 28630
1 parent 44af3d6 commit 74bb5e3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/profiling/src/datasource/datasource.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
type DataQueryResponse,
3232
DataSourceApi,
3333
type DataSourceInstanceSettings,
34+
LoadingState,
3435
toDataFrame,
3536
} from '@grafana/data';
3637
import {
@@ -95,7 +96,12 @@ export default class DashboardDatasource extends DataSourceApi<ProfilingQuery, Q
9596
}
9697
subscriber.next({ data: [toDataFrame(events)] });
9798
})
98-
.catch(err => subscriber.error(err))
99+
.catch(e => {
100+
return subscriber.error({
101+
state: LoadingState.Error,
102+
message: e?.message || e?.error_details?.overview || '请求失败',
103+
});
104+
})
99105
.finally(() => subscriber.complete());
100106
}),
101107
);

0 commit comments

Comments
 (0)