Skip to content

Commit b129202

Browse files
committed
Change catch block from URLParserException to Exception in ResponseParser.kt and DavResource.kt
1 parent 7b4fc71 commit b129202

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/main/kotlin/at/bitfire/dav4jvm/ktor/DavResource.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import io.ktor.http.HttpHeaders
4141
import io.ktor.http.HttpMethod
4242
import io.ktor.http.HttpStatusCode
4343
import io.ktor.http.URLBuilder
44-
import io.ktor.http.URLParserException
4544
import io.ktor.http.Url
4645
import io.ktor.http.contentType
4746
import io.ktor.http.isSecure
@@ -643,7 +642,7 @@ open class DavResource(
643642
URLBuilder(location)
644643
.takeFrom(newLocation)
645644
.build()
646-
} catch (e: URLParserException) {
645+
} catch (e: Exception) {
647646
throw DavException("Redirected to invalid Location", cause = e)
648647
}
649648

src/main/kotlin/at/bitfire/dav4jvm/ktor/ResponseParser.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import at.bitfire.dav4jvm.property.webdav.ResourceType
1717
import at.bitfire.dav4jvm.property.webdav.WebDAV
1818
import io.ktor.http.HttpStatusCode
1919
import io.ktor.http.URLBuilder
20-
import io.ktor.http.URLParserException
2120
import io.ktor.http.Url
2221
import io.ktor.http.isSuccess
2322
import io.ktor.http.takeFrom
@@ -168,7 +167,7 @@ class ResponseParser(
168167

169168
val urlBuilder = try {
170169
URLBuilder(location).takeFrom(sHref)
171-
} catch (e: URLParserException) {
170+
} catch (e: Exception) {
172171
logger.log(Level.WARNING, "Unresolvable <href> in <response>: $hrefString", e)
173172
return null
174173
}

0 commit comments

Comments
 (0)