Error Handling: support errors and data in a response (#20169)

This commit is contained in:
Ryan McKinley
2019-11-05 15:20:04 -08:00
committed by GitHub
parent 7a3d1c0e4b
commit 92ab4d80f0
9 changed files with 68 additions and 13 deletions
+20
View File
@@ -283,6 +283,26 @@ func init() {
},
})
registerScenario(&Scenario{
Id: "random_walk_with_error",
Name: "Random Walk (with error)",
Handler: func(query *tsdb.Query, context *tsdb.TsdbQuery) *tsdb.QueryResult {
queryRes := getRandomWalk(query, context)
queryRes.ErrorString = "This is an error. It can include URLs http://grafana.com/"
return queryRes
},
})
registerScenario(&Scenario{
Id: "server_error_500",
Name: "Server Error (500)",
Handler: func(query *tsdb.Query, context *tsdb.TsdbQuery) *tsdb.QueryResult {
panic("Test Data Panic!")
},
})
registerScenario(&Scenario{
Id: "logs",
Name: "Logs",