ReportError writes the error of the query to the response.
(queryIndex int, table string, err error, statusCode int)
| 325 | |
| 326 | // ReportError writes the error of the query to the response. |
| 327 | func (w *JSONQueryResponseWriter) ReportError(queryIndex int, table string, err error, statusCode int) { |
| 328 | // Usually larger status code means more severe problem. |
| 329 | if statusCode > w.statusCode { |
| 330 | w.statusCode = statusCode |
| 331 | } |
| 332 | if w.response.Errors == nil { |
| 333 | w.response.Errors = make([]error, len(w.response.Results)) |
| 334 | } |
| 335 | w.response.Errors[queryIndex] = err |
| 336 | utils.GetRootReporter().GetChildCounter(map[string]string{ |
| 337 | "table": table, |
| 338 | }, utils.QueryFailed).Inc(1) |
| 339 | } |
| 340 | |
| 341 | // ReportQueryContext writes the query context to the response. |
| 342 | func (w *JSONQueryResponseWriter) ReportQueryContext(qc *query.AQLQueryContext) { |
no test coverage detected