From 21a928bf70401a2822a1571fc1a02e3545ff1bee Mon Sep 17 00:00:00 2001 From: Alex Savin Date: Mon, 9 Jun 2025 12:46:14 -0400 Subject: [PATCH] Debuging response outputs --- client.go | 3 ++- mysubaru.go | 1 + vehicle.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index ee40b7d..708e782 100644 --- a/client.go +++ b/client.go @@ -242,6 +242,7 @@ func (c *Client) execute(requestUrl string, method string, params map[string]str if err != nil { 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 { // 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 err := json.Unmarshal(r.Data, &sr) 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 != "" { diff --git a/mysubaru.go b/mysubaru.go index 695d94c..a6baa58 100644 --- a/mysubaru.go +++ b/mysubaru.go @@ -281,6 +281,7 @@ type ServiceRequest struct { // "dataName":"errorResponse" // {"success":false,"errorCode":"404-soa-unableToParseResponseBody","dataName":"errorResponse","data":{"errorLabel":"404-soa-unableToParseResponseBody","errorDescription":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"}} type ErrorResponse struct { ErrorLabel string `json:"errorLabel"` // "404-soa-unableToParseResponseBody" diff --git a/vehicle.go b/vehicle.go index 5acf959..3f065c1 100644 --- a/vehicle.go +++ b/vehicle.go @@ -587,7 +587,7 @@ func (v *Vehicle) GetVehicleStatus() { v.selectVehicle() reqURL := MOBILE_API_VERSION + urlToGen(apiURLs["API_VEHICLE_STATUS"], v.getAPIGen()) 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 { var vs VehicleStatus @@ -639,7 +639,7 @@ func (v *Vehicle) GetVehicleCondition() { v.selectVehicle() reqURL := MOBILE_API_VERSION + urlToGen(apiURLs["API_CONDITION"], v.getAPIGen()) 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 { var sr ServiceRequest