From: prathamesh morde Date: Wed, 3 Apr 2019 21:54:45 +0000 (-0400) Subject: BluePrintManagmentGRPC handler should send failure message back to the client. X-Git-Tag: 0.4.2~113 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F84147%2F1;p=ccsdk%2Fcds.git 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 --- 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)) } } }