setErrorAndLog sets the response error and internal error (if non-nil) and logs them along with the provided debug format string and arguments.
(w *Response, responseError string, internalError error, debugFormat string, debugArgs ...interface{})
| 555 | |
| 556 | // setErrorAndLog sets the response error and internal error (if non-nil) and logs them along with the provided debug format string and arguments. |
| 557 | func (s Server) setErrorAndLog(w *Response, responseError string, internalError error, debugFormat string, debugArgs ...interface{}) { |
| 558 | format := "error=%v, internal_error=%#v " + debugFormat |
| 559 | |
| 560 | w.InternalError = internalError |
| 561 | w.SetError(responseError, "") |
| 562 | |
| 563 | s.Logger.Printf(format, append([]interface{}{responseError, internalError}, debugArgs...)...) |
| 564 | } |