Skip to content

Commit

Permalink
broken aggregated response fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Balarev <andrey.balarev@bosch.io>
  • Loading branch information
abalarev committed May 9, 2022
1 parent 4d9b80f commit 029a850
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -399,13 +399,13 @@ private void deserializePiggybackCommand(final ExecutePiggybackCommand command,
serviceMappingStrategy.getMappingStrategy(piggybackCommandType).ifPresentOrElse(action, emptyAction);
}

private static DevOpsErrorResponse getErrorResponse(final DevOpsCommand<?> command, final JsonObject error) {
final String serviceName = command.getServiceName().orElse(null);
final String instance = command.getInstance().map(String::valueOf).orElse(null);
return DevOpsErrorResponse.of(serviceName, instance, error, command.getDittoHeaders());
private DevOpsErrorResponse getErrorResponse(final DevOpsCommand<?> command, final JsonObject error) {
final String responseServiceName = command.getServiceName().orElse(this.serviceName);
final String responseInstance = command.getInstance().map(String::valueOf).orElse(this.instance);
return DevOpsErrorResponse.of(responseServiceName, responseInstance, error, command.getDittoHeaders());
}

private static DevOpsErrorResponse getErrorResponse(final DevOpsCommand<?> command) {
private DevOpsErrorResponse getErrorResponse(final DevOpsCommand<?> command) {
final JsonObject error = JsonFactory.newObjectBuilder()
.set(DittoRuntimeException.JsonFields.STATUS, HttpStatus.BAD_REQUEST.getCode())
.set(DittoRuntimeException.JsonFields.MESSAGE,
Expand Down

0 comments on commit 029a850

Please sign in to comment.