Skip to content

Commit

Permalink
Change BaseModel to extend ToXContentObject instead of ToXContent (#173)
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammad Qureshi <[email protected]>
Signed-off-by: Zelin Hao <[email protected]>
  • Loading branch information
qreshi authored and zelinh committed Aug 18, 2022
1 parent da75756 commit 03d4324
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down

0 comments on commit 03d4324

Please sign in to comment.