[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / lib / openecomp-sdc-model-lib / openecomp-sdc-model-api / src / main / java / org / openecomp / core / model / types / ServiceArtifactEntity.java
index c5dfece..8abbbd3 100644 (file)
@@ -27,6 +27,12 @@ import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.Frozen;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
+import org.openecomp.sdc.logging.types.LoggerConstants;
+import org.openecomp.sdc.logging.types.LoggerErrorCode;
+import org.openecomp.sdc.logging.types.LoggerErrorDescription;
+import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.io.IOException;
@@ -71,6 +77,10 @@ public class ServiceArtifactEntity implements ServiceElementEntity {
     try {
       this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent()));
     } catch (IOException ioException) {
+      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
+          LoggerTragetServiceName.CREATE_SERVICE_ARTIFACT, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.DATA_ERROR.getErrorCode(),
+          LoggerErrorDescription.CREATE_SERVICE_ARTIFACT);
       throw new RuntimeException(ioException);
     }