Skip to content

Commit

Permalink
Changed logging for Factory on missing topic
Browse files Browse the repository at this point in the history
Signed-off-by: Arnau Mora <[email protected]>
  • Loading branch information
ArnyminerZ committed Jul 25, 2024
1 parent 2b41498 commit 683fb87
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/kotlin/at/bitfire/dav4jvm/property/push/Topic.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ package at.bitfire.dav4jvm.property.push
import at.bitfire.dav4jvm.Property
import at.bitfire.dav4jvm.PropertyFactory
import at.bitfire.dav4jvm.XmlUtils
import at.bitfire.dav4jvm.exception.InvalidPropertyException
import org.xmlpull.v1.XmlPullParser
import java.util.logging.Level
import java.util.logging.Logger

/**
* Represents a `{DAV:Push}topic` property.
Expand All @@ -30,10 +33,16 @@ class Topic private constructor(

object Factory: PropertyFactory {

private val logger = Logger.getLogger(javaClass.name)

override fun getName() = NAME

override fun create(parser: XmlPullParser) =
override fun create(parser: XmlPullParser): Topic? = try {
Topic(XmlUtils.requireReadText(parser))
} catch (e: InvalidPropertyException) {
logger.log(Level.INFO, "Invalid or missing topic property. Push is not supported", e)
null
}

}

Expand Down

0 comments on commit 683fb87

Please sign in to comment.