From 835c347f632c32d67ad5051b8dd93b059e1eadaf Mon Sep 17 00:00:00 2001 From: prathamesh morde Date: Wed, 3 Apr 2019 17:54:45 -0400 Subject: BluePrintManagmentGRPC handler should send failure message back to the client. -Added StreamObserver.onError so the client would be aware of failure if any. Change-Id: Iecd019ef4ff4b4b4c522e0eb6e242770afdcdfcd Issue-ID: CCSDK-1197 Signed-off-by: prathamesh morde --- .../selfservice/api/BluePrintManagementGRPCHandler.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ms/blueprintsprocessor') diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt index 251ae2c3a..549d6cd9f 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt @@ -62,7 +62,7 @@ open class BluePrintManagementGRPCHandler(private val bluePrintPathConfiguration responseObserver.onNext(successStatus("Successfully uploaded CBA($blueprintId)...", request.commonHeader)) responseObserver.onCompleted() } catch (e: Exception) { - failStatus("request(${request.commonHeader.requestId}): Failed to upload CBA", e) + responseObserver.onError(failStatus("request(${request.commonHeader.requestId}): Failed to upload CBA", e)) } finally { deleteDir(bluePrintPathConfiguration.blueprintArchivePath, uploadId) deleteDir(bluePrintPathConfiguration.blueprintWorkingPath, uploadId) @@ -87,7 +87,7 @@ open class BluePrintManagementGRPCHandler(private val bluePrintPathConfiguration responseObserver.onNext(successStatus("Successfully deleted $blueprint", request.commonHeader)) responseObserver.onCompleted() } catch (e: Exception) { - failStatus("request(${request.commonHeader.requestId}): Failed to delete $blueprint", e) + responseObserver.onError(failStatus("request(${request.commonHeader.requestId}): Failed to delete $blueprint", e)) } } } -- cgit 1.2.3-korg