diff --git a/src/main/kotlin/org/opensearch/commons/notifications/model/BaseModel.kt b/src/main/kotlin/org/opensearch/commons/notifications/model/BaseModel.kt index 5ead5594..056fcc6e 100644 --- a/src/main/kotlin/org/opensearch/commons/notifications/model/BaseModel.kt +++ b/src/main/kotlin/org/opensearch/commons/notifications/model/BaseModel.kt @@ -5,9 +5,9 @@ package org.opensearch.commons.notifications.model import org.opensearch.common.io.stream.Writeable -import org.opensearch.common.xcontent.ToXContent +import org.opensearch.common.xcontent.ToXContentObject /** * interface for representing objects. */ -interface BaseModel : Writeable, ToXContent +interface BaseModel : Writeable, ToXContentObject diff --git a/src/main/kotlin/org/opensearch/commons/notifications/model/NotificationEvent.kt b/src/main/kotlin/org/opensearch/commons/notifications/model/NotificationEvent.kt index 6bc49d5f..2ab5426b 100644 --- a/src/main/kotlin/org/opensearch/commons/notifications/model/NotificationEvent.kt +++ b/src/main/kotlin/org/opensearch/commons/notifications/model/NotificationEvent.kt @@ -111,6 +111,7 @@ data class NotificationEvent( return try { XContentHelper.toXContent(this, XContentType.JSON, EMPTY_PARAMS, true).utf8ToString() } catch (e: IOException) { + log.debug("Failed to convert NotificationEvent to string", e) super.toString() + " threw " + e.toString() } }