code: func WrapErrorForTagDB(e error) *ErrorResp {
  	b, err := json.Marshal(TagDBError{Error: e.Error()})
  	if err != nil {
  		return &ErrorResp{
  			err:  "{\"error\": \"failed to encode error message\"}",
  			code: http.StatusInternalServerError,
  		}
  	}
  
  	resp := &ErrorResp{
  		err:  string(b),
  		code: http.StatusInternalServerError,
  	}
  
  	if _, ok := e.(Error); ok {
  		resp.code = e.(Error).Code()
  	}
  
  	resp.ValidateAndFixCode()
  	return resp
  }
docs: // graphite's http tagdb client requires a specific error format