Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Made validation error logging more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
falu2010-netflix committed Feb 6, 2019
1 parent d054616 commit b3bc28e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
Expand Up @@ -77,6 +77,10 @@ public String toString() {
builder.append(", instance: ").append(instance);
}

if (this.validationErrors != null) {
builder.append(", validationErrors: ").append(validationErrors.toString());
}

builder.append("}");
return builder.toString();
}
Expand Down
Expand Up @@ -2,6 +2,7 @@

import java.util.List;
import com.netflix.conductor.common.validation.ValidationError;
import java.util.StringJoiner;


//TODO: Use one from common
Expand Down Expand Up @@ -53,4 +54,15 @@ public String getInstance() {
public void setInstance(String instance) {
this.instance = instance;
}

@Override
public String toString() {
return new StringJoiner(", ", ErrorResponse.class.getSimpleName() + "[", "]")
.add("code='" + code + "'")
.add("message='" + message + "'")
.add("instance='" + instance + "'")
.add("retryable=" + retryable)
.add("validationErrors=" + validationErrors)
.toString();
}
}
Expand Up @@ -255,7 +255,7 @@ private void handleUniformInterfaceException(UniformInterfaceException exception
return;
}
String errorMessage = clientResponse.getEntity(String.class);
logger.error("Unable to invoke Conductor API with uri: {}, unexpected response from server: {}", uri, clientResponseToString(exception.getResponse()), exception);
logger.error("Unable to invoke Conductor API with uri: {}, unexpected response from server: statusCode={}, responseBody='{}'.", uri, clientResponse.getStatus(), errorMessage);
ErrorResponse errorResponse;
try {
errorResponse = objectMapper.readValue(errorMessage, ErrorResponse.class);
Expand Down
@@ -1,6 +1,7 @@
package com.netflix.conductor.common.validation;

import com.netflix.conductor.common.validation.ErrorResponse;
import java.util.StringJoiner;

/**
* Captures a validation error that can be returned in {@link ErrorResponse}.
Expand Down Expand Up @@ -42,5 +43,14 @@ public void setMessage(String message) {
public void setInvalidValue(String invalidValue) {
this.invalidValue = invalidValue;
}

@Override
public String toString() {
return new StringJoiner(", ", ValidationError.class.getSimpleName() + "[", "]")
.add("path='" + path + "'")
.add("message='" + message + "'")
.add("invalidValue='" + invalidValue + "'")
.toString();
}
}

0 comments on commit b3bc28e

Please sign in to comment.