diff --git a/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt b/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt index d2b945c8..4c63a07c 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt @@ -46,7 +46,7 @@ data class Alert( ) : Writeable, ToXContent { init { - if (errorMessage != null) require(state == State.DELETED || state == State.ERROR || state == State.DELETED) { + if (errorMessage != null) require(state == State.DELETED || state == State.ERROR || state == State.AUDIT) { "Attempt to create an alert with an error in state: $state" } }