mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Panel: Show multiple errors info in the inspector (#64340)
This commit is contained in:
committed by
GitHub
parent
3292cb86ae
commit
15aae5e8a9
@@ -54,6 +54,7 @@ const resWithError = {
|
||||
results: {
|
||||
A: {
|
||||
error: 'Hello Error',
|
||||
status: 400,
|
||||
frames: [
|
||||
{
|
||||
schema: {
|
||||
@@ -354,12 +355,14 @@ describe('Query Response parser', () => {
|
||||
{
|
||||
"message": "Hello Error",
|
||||
"refId": "A",
|
||||
"status": 400,
|
||||
}
|
||||
`);
|
||||
expect(res.errors).toEqual([
|
||||
{
|
||||
message: 'Hello Error',
|
||||
refId: 'A',
|
||||
status: 400,
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ export interface DataResponse {
|
||||
error?: string;
|
||||
refId?: string;
|
||||
frames?: DataFrameJSON[];
|
||||
status?: number;
|
||||
|
||||
// Legacy TSDB format...
|
||||
series?: TimeSeries[];
|
||||
@@ -86,12 +87,13 @@ export function toDataQueryResponse(
|
||||
rsp.error = {
|
||||
refId: dr.refId,
|
||||
message: dr.error,
|
||||
status: dr.status,
|
||||
};
|
||||
}
|
||||
if (rsp.errors) {
|
||||
rsp.errors.push({ refId: dr.refId, message: dr.error });
|
||||
rsp.errors.push({ refId: dr.refId, message: dr.error, status: dr.status });
|
||||
} else {
|
||||
rsp.errors = [{ refId: dr.refId, message: dr.error }];
|
||||
rsp.errors = [{ refId: dr.refId, message: dr.error, status: dr.status }];
|
||||
}
|
||||
rsp.state = LoadingState.Error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user