use of com.netflix.spinnaker.halyard.core.problem.v1.ProblemBuilder in project halyard by spinnaker.
the class OrcaRunner method findError.
private static Problem findError(HasContext hasContext) {
if (hasContext == null) {
return null;
}
Context context = hasContext.getContext();
if (context == null) {
return null;
}
ExecutionException exception = context.getException();
if (exception == null) {
return null;
}
StringBuilder message = new StringBuilder();
String operation = exception.getOperation();
if (operation != null) {
message.append(formatId(operation)).append(": ");
}
ExecutionException.Details details = exception.getDetails();
if (details == null) {
message.append("No error details found.");
} else {
message.append("(").append(details.getError()).append(") ");
for (String error : details.getErrors()) {
message.append(error).append(" ");
}
}
return new ProblemBuilder(Problem.Severity.FATAL, message.toString()).build();
}
use of com.netflix.spinnaker.halyard.core.problem.v1.ProblemBuilder in project halyard by spinnaker.
the class GoogleWriteableProfileRegistry method writeTextObject.
private void writeTextObject(String name, String contents) {
try {
byte[] bytes = contents.getBytes();
StorageObject object = new StorageObject().setBucket(spinconfigBucket).setName(name);
ByteArrayContent content = new ByteArrayContent("application/text", bytes);
storage.objects().insert(spinconfigBucket, object, content).execute();
} catch (IOException e) {
log.error("Failed to write new object " + name, e);
throw new HalException(new ProblemBuilder(Severity.FATAL, "Failed to write to " + name + ": " + e.getMessage()).build());
}
}
use of com.netflix.spinnaker.halyard.core.problem.v1.ProblemBuilder in project halyard by spinnaker.
the class DaemonTask method failure.
public void failure(Exception e) {
inFailedState();
fatalError = e;
Problem problem = new ProblemBuilder(Problem.Severity.FATAL, "Unexpected exception: " + e).build();
response = new DaemonResponse<>(null, new ProblemSet(problem));
}
Aggregations