Debuging response outputs
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 25s

This commit is contained in:
2025-06-09 12:46:14 -04:00
parent cb008f61e7
commit 21a928bf70
3 changed files with 5 additions and 3 deletions

View File

@ -242,6 +242,7 @@ func (c *Client) execute(requestUrl string, method string, params map[string]str
if err != nil { if err != nil {
c.logger.Error("error while getting body", "error", err.Error()) c.logger.Error("error while getting body", "error", err.Error())
} }
c.logger.Debug("parsed http request output", "data", string(resBytes))
if r, ok := c.parseResponse(resBytes); ok { if r, ok := c.parseResponse(resBytes); ok {
// c.logger.Debug("parsed http request output", "data", r.Data) // c.logger.Debug("parsed http request output", "data", r.Data)
@ -251,7 +252,7 @@ func (c *Client) execute(requestUrl string, method string, params map[string]str
var sr ServiceRequest var sr ServiceRequest
err := json.Unmarshal(r.Data, &sr) err := json.Unmarshal(r.Data, &sr)
if err != nil { if err != nil {
c.logger.Error("error while parsing json", "request", "HTTP POLLING", "error", err.Error()) c.logger.Error("error while parsing json", "request", "remoteServiceStatus", "error", err.Error())
} }
if pollingUrl != "" { if pollingUrl != "" {

View File

@ -281,6 +281,7 @@ type ServiceRequest struct {
// "dataName":"errorResponse" // "dataName":"errorResponse"
// {"success":false,"errorCode":"404-soa-unableToParseResponseBody","dataName":"errorResponse","data":{"errorLabel":"404-soa-unableToParseResponseBody","errorDescription":null}} // {"success":false,"errorCode":"404-soa-unableToParseResponseBody","dataName":"errorResponse","data":{"errorLabel":"404-soa-unableToParseResponseBody","errorDescription":null}}
// {"success":false,"errorCode":"vehicleNotInAccount","dataName":null,"data":null} // {"success":false,"errorCode":"vehicleNotInAccount","dataName":null,"data":null}
// {"httpCode":500,"errorCode":"error","errorMessage":"java.lang.NullPointerException - null"}
// {"success":false,"errorCode":"InvalidCredentials","dataName":"remoteServiceStatus","data":{"serviceRequestId":null,"success":false,"cancelled":false,"remoteServiceType":null,"remoteServiceState":null,"subState":null,"errorCode":null,"result":null,"updateTime":null,"vin":null,"errorDescription":"The credentials supplied are invalid, tries left 2"}} // {"success":false,"errorCode":"InvalidCredentials","dataName":"remoteServiceStatus","data":{"serviceRequestId":null,"success":false,"cancelled":false,"remoteServiceType":null,"remoteServiceState":null,"subState":null,"errorCode":null,"result":null,"updateTime":null,"vin":null,"errorDescription":"The credentials supplied are invalid, tries left 2"}}
type ErrorResponse struct { type ErrorResponse struct {
ErrorLabel string `json:"errorLabel"` // "404-soa-unableToParseResponseBody" ErrorLabel string `json:"errorLabel"` // "404-soa-unableToParseResponseBody"

View File

@ -587,7 +587,7 @@ func (v *Vehicle) GetVehicleStatus() {
v.selectVehicle() v.selectVehicle()
reqURL := MOBILE_API_VERSION + urlToGen(apiURLs["API_VEHICLE_STATUS"], v.getAPIGen()) reqURL := MOBILE_API_VERSION + urlToGen(apiURLs["API_VEHICLE_STATUS"], v.getAPIGen())
resp := v.client.execute(reqURL, GET, map[string]string{}, "", false) resp := v.client.execute(reqURL, GET, map[string]string{}, "", false)
v.client.logger.Info("http request output", "request", "GetVehicleStatus", "body", resp) // v.client.logger.Info("http request output", "request", "GetVehicleStatus", "body", resp)
if r, ok := v.client.parseResponse(resp); ok { if r, ok := v.client.parseResponse(resp); ok {
var vs VehicleStatus var vs VehicleStatus
@ -639,7 +639,7 @@ func (v *Vehicle) GetVehicleCondition() {
v.selectVehicle() v.selectVehicle()
reqURL := MOBILE_API_VERSION + urlToGen(apiURLs["API_CONDITION"], v.getAPIGen()) reqURL := MOBILE_API_VERSION + urlToGen(apiURLs["API_CONDITION"], v.getAPIGen())
resp := v.client.execute(reqURL, GET, map[string]string{}, "", false) resp := v.client.execute(reqURL, GET, map[string]string{}, "", false)
v.client.logger.Info("http request output", "request", "GetVehicleCondition", "body", resp) // v.client.logger.Info("http request output", "request", "GetVehicleCondition", "body", resp)
if r, ok := v.client.parseResponse(resp); ok { if r, ok := v.client.parseResponse(resp); ok {
var sr ServiceRequest var sr ServiceRequest